The essential news about content management systems and mobile technology. Powered by Perfect Publisher and XT Search for Algolia.
The News Site publishes posts to the following channels: Facebook, Instagram, Twitter, Telegram, Web Push, Tumblr, and Blogger.
Read more https://build.prestashop-project.org/news/2024/prestashop-1-7-8-11-maintenance-release/
Sublime Text in 2024 is a powerful, viable text editor that I find delightedly minimal, fast, and productive. While the core of my Sublime setup hasn't changed much, I wanted to share the details of my setup and some essential plugins I cannot live without in 2024. I wrote about my Minimalist Sublime Text 3 Setup for PHP back in 2018 (wow time flies), and I still feel like the heart of my experience is similar in 2024. I aim for a minimal setup. However, I have found some valuable plugins that save time and make me more productive.
Sublime has a lot of themes available, and I've tried many of them, but I've found a permanent home with the Monokai Pro theme:
I prefer the Octagon version, but all of them are really, really good, and I am sure you'll find something you'll love. This theme requires a license, but you can try it out before you buy it with popup reminders to buy a license. For me, it's well worth the ~ $13 USD price. I also have the VS Code license as sometimes I'll use VS Code for specific tasks (i.e., Astro has a much better experience in VS Code), and I like the consistency of themes as I jump between editors.
Along with Monokai Pro, I use the paid Operator Mono font (Book) as I find it the most readable coding font I've ever tried. I have also tried out JetBrains Mono, and that's what I'd recommend if you don't want to fork out $200+ USD for Operator Mono.
Font size and spacing is a personal thing, but here's what my font-related settings look like in Sublime Text:
{
"font_face": "Operator Mono Book",
"font_size": 14,
"line_numbers": true,
"line_padding_bottom": 8,
"line_padding_top": 8,
"smart_indent": true,
"spell_check": false,
"tab_size": 4,
"theme": "Monokai Pro (Filter Octagon).sublime-theme",
"word_wrap": true,
"scroll_past_end": true,
}
I will not list out each plugin I have installed, but I'll highlight the plugins I think will have a big impact on making Sublime Text a fantastic editing experience in 2024. I've recently started Using Language Servers in Sublime Text, a huge level up for code intelligence in many languages supported by the Sublime LSP package.
The LSP PHP package (I use Intelliphense) is the only PHP plugin I use with Sublime Text. It does most everything I need, and gives much better code intelligence than the default experience.
Besides the LSP plugin, here's what I cannot live without:
.editorconfig
file.Using static analysis tools like PHPStan is imperative if you want to use a text editor as your primary driver. You'll definitely miss some things. However, the LSP plugin improves calling your attention to these issues.
I love snippets, and I recommend developers have their own curated collection of snippets that they can collect over time. Some of my most used snippets are for creating class methods:
pubf - creates a method with public visibility
prof - starts a snippet with protected visibility
prif - starts a snippet with protected visibility
Here's an example snippet from the above pubf
snippet:
<snippet>
<content><![CDATA[
public function $1()
{
$0
}
]]></content>
<tabTrigger>pubf</tabTrigger>
<scope>source.php</scope>
</snippet>
Another one I use all the time is the test
snippet
(which I activate with tab), which creates a phpunit
test case:
<snippet>
<content><![CDATA[
public function test_$1()
{
$0
}
]]></content>
<description>Create a PHPUnit Test Case</description>
<tabTrigger>test</tabTrigger>
<scope>source.php</scope>
</snippet>
You can see my paulredmond/sublime-snippets snippets plugin for
Sublime. To install this plugin, I use git clone
:
git clone https://github.com/paulredmond/sublime-snippets \
~/Library/Application\ Support/Sublime\ Text/Packages/User/sublime-snippets
Your path to user packages might be different! You can find out by going to Sublime Text > Preferences > Browse Packages and then look for a User folder. That path is where you want to copy/clone your snippets.
Editors like PhpStorm and VS Code have integrated version control tools and other tools for visual diffs and committing code. I have always used the CLI for Git commands, so jumping between Sublime Text and my terminal isn't jarring. I use Git Mergetool to view diffs and merge conflicts. Another suggestion is to use GitHub Desktop. Finally, Sublime has a companion app for Sublime Text called Sublime Merge, which will give you a similar Sublime experience for your version control.
Though some developers have moved on from Sublime Text, I appreciate a minimal, humble text editor. Web developers' toolchains have become incredibly complex, and I long for the days when a text editor's primary role was, well, text editing.
The post My Sublime Text Setup in 2024 for Web Development appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/my-sublime-text-setup-in-2024-for-web-development
The Filament documentation offers a nice copy-and-paste solution for generating slugs from a title.
This example sets the title field to be a Livewire Live field, and then, as you enter characters, it generates a slug and sets it to another form field.
use Filament\Forms\Components\TextInput;
use Filament\Forms\Set;
use Illuminate\Support\Str;
TextInput::make('title')
->live()
->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state)))
TextInput::make('slug')
This works great for most situations, but I wanted to take this a step further and only dynamically change the slug if it’s either a new entry or if it’s not been published yet. Otherwise, if a slug gets changed, it’ll cause a 404 since the old one doesn’t exist.
To solve this, here is an updated version that only updates if it’s a new record or hasn’t been published:
TextInput::make('title')
->live()
->afterStateUpdated(function (Get $get, Set $set, ?string $operation, ?string $old, ?string $state, ?Model $record) {
if ($operation == 'edit' && $record->isPublished()) {
return;
}
if (($get('slug') ?? '') !== Str::slug($old)) {
return;
}
$set('slug', Str::slug($state));
})
To explain the code, the afterStateUpdated
in
Filament allows you to inject both the operation (create or edit)
and the model, which you can then use to determine if the slug
should be updated or left alone. That is what the if statement
does:
if ($operation == 'edit' && $record->isPublished())
This says that if we are on the edit page and the Model is published, skip dynamically setting the slug.
You might also want to make the slug field disabled if the record is already published, and that can be accomplished easily:
TextInput::make('slug')
->required()
->maxLength(255)
->unique(Article::class, 'slug', fn ($record) => $record)
->disabled(fn (?string $operation, ?Model $record) => $operation == 'edit' && $record->isPublished())
Thanks to Alex Six for helping me set this up and work.
The post Generating slugs from a title in Filament appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/generating-slugs-from-a-title-in-filament
Helge Sverre released a new Blade Heroicons Upgrader package that is specifically designed for updating from Heroicons v1 to v2 in Blade files where many icons were renamed or removed between the major versions.
This tool replaces old icon names in your code, such as @svg("clipboard-check") and , and updates them to their new v2 equivalents such as @svg("clipboard-document-check") and .
Run the command to upgrade your blade files:
php artisan blade-heroicons-upgrader:upgrade
You may also specify one or more files or directories to run replacements on:
php artisan blade-heroicons-upgrader:upgrade ./resources/views ./app/Composers/MenuComposer.php
You can also do a dry run to see how many replacements in which files will be done.
php artisan blade-heroicons-upgrader:upgrade --dry
For complete details on this package, see the GitHub repo, and happy updating!
The post Blade Heroicons Upgrader appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/blade-heroicons-upgrader
Our team here at WordPress.com, comprised of hundreds of people spread across the entire globe, accomplished a lot in 2023. On the blog, we published over 90 posts, from product upgrades, to brand new features, and even new additions to the Automattic family of products.
If you missed anything, here’s a recap of this year’s most important launches, announcements, and new features.
Table of Contents
This year the Jetpack mobile app has made huge strides as the preferred mobile experience for WordPress.com customers. The team is continuously improving the app, making publishing, reading, and monitoring engagement easier than ever. If you haven’t tried it yet, now is the time!
Newsletters on WordPress.com have seen a huge number of improvements in 2023—from features like paid subscriptions on any plan and the introduction of a Paywall Block, to fresh resources like our Newsletters 101 course. No matter how you want to reach your audience, WordPress.com has you covered. Get started here.
Early in the year, we launched Blaze—our self-serve advertising tool. This cool new feature allows anyone with a WordPress blog to advertise on WordPress.com and Tumblr in just a few clicks. How? By turning your site content into clean, compelling ads that run across our millions-strong network of blogs. Here are 5 tips for making the most of your ads.
This innovative plugin brings a whole new level of social networking to your website by integrating it with the wider federated social web. When installed, the plugin allows you to easily share your content and interact with users on Mastodon and other platforms that also support the ActivityPub protocol. Just as Automattic aims to do with all of our products, this plugin helps to decentralize the web, break down silos, and foster a more connected online ecosystem. Click here to learn more about getting started with ActivityPub for WordPress.
On May 27, 2003, co-founders Matt Mullenweg and Mike Little announced that WordPress was available to the public. Their vision, as you can still read in their original post on WordPress.org, was to foster a means by which anyone could easily share and discuss their ideas with the world. What started as a humble open-source blogging platform is now the driving force behind over one-third of the internet’s most popular websites, including The New York Times, Salesforce, and Disney.
In May, we announced the availability of staging sites, which made it easy to experiment with changes to your site. A few months later, we added to its capabilities with a synchronization feature that allows you to push changes from your staging site to your live, or “production,” site. You can now fearlessly try out new ideas and designs before publishing them to the world.
For all the developers and professional site creators out there, we’ve also launched SSH and WP-CLI access, site preview links, and global edge caching. Be sure to stay up to date with these technical tools at our WordPress.com Develop Blog.
In addition to launching a new and improved mobile app, our intrepid Jetpack team also made significant changes to the Stats page. This all-new experience enhances your ability to analyze and optimize your site’s content. We’ve restructured the layout in a friendlier way, introduced new modules that reveal crucial data points, and revamped the overall look of this powerful analytics tool. Check it out for yourself.
Whether you want a simple blog that highlights recent posts, a visually stunning portfolio, or an online home for your small business, your website should be just as unique as you are. Our new site design tool guides you through the process of creating a memorable custom homepage, utilizing a library of hundreds of patterns, colors, and fonts that you can mix and match for whichever distinctive vibe you’re going for. Try it out for yourself right here.
Your domain is the lifeblood of your online presence. This year, we’ve been hard at work building a number of exciting features to ensure a world-class domain name experience on WordPress.com whether you have one domain or one hundred. We’ve introduced an all-new domains-focused dashboard, multi-year registrations, domain forwarding, convenient transfer, simple DNS imports, and more. Oh, by the way, if you’re coming from Google Domains, we’ll cover your transfer fees. Grab your piece of online real estate today.
In October, Automattic welcomed Texts.com to our growing family. This handy app brings all your chats into a single dashboard: iMessage, Slack, WhatsApp, Instagram, Telegram, Messenger, LinkedIn, Signal, Discord, and X, with more services on the way. Beyond the unmatched convenience, Texts.com also offers end-to-end encryption, as well as some delightful features that other messaging apps can’t seem to figure out, like scheduling messages to send when your recipient is awake, or the ability to mark as unread on services that still don’t have it. Sign up today. (Psst, be sure to check back for news on the iOS app!)
Our incredible design and education teams moved all of our learning resources—courses, webinars, tutorials, forums, and more—into one convenient and beautifully-designed place at WordPress.com/learn. Our mission with the learning hub is to have one spot for all your WordPress.com questions and learning opportunities. Spend some time with this resource center and come away more confident than ever.
Jetpack AI Assistant is seamlessly integrated as a block within the WordPress.com editor. Whether you’re checking your spelling and grammar, need ideas for better titles or headings, or simply in need of an outline for your great idea, this incredible feature can help jumpstart your creativity. Give it a shot in the editor today by using the AI Assistant Block.
WordPress is constantly improving and making it easier than ever to write, publish, and design your site. This year, we’ve seen the addition of the Details Block, footnotes, distraction-free mode, a style book (which lets you preview design variations), customizable button styles, sticky headers, Openverse integration, the Time to Read Block, and so much more.
Our amazing themes design team released more themes in 2023 than any previous year in our history. Whether you’re a business owner, a community leader, a hobbyist, a blogger, or anything in between, you’re guaranteed to find a theme that matches the vision you have for your website. Check out the entire theme showcase to get a peek at the incredible variety of our design offerings. And there’s plenty more to come in 2024 and beyond; if you’re looking for something specific and can’t find it, let us know in the comments.
Read more https://wordpress.com/blog/2023/12/29/2023-year-in-review/