What’s Laravel and Laravel 10?
Laravel is one of the most popular frameworks in PHP, which is used by web developers to create web applications . The latest release of Laravel is version 10 which was launched on February 14, 2023, and it includes several new features and improvements. As we move ahead in this blog, we will be exploring the latest inclusions and improvements in this new version of Laravel.
What’s new in Laravel 10?
The best part about the new release is the inclusion of new features and updates. So without wasting any more seconds, let’s take a look at new features and updates in Laravel.
New Updates & Features in Laravel 10
1.Version Required:
To run Laravel 10.x, you at least need a PHP 8.1 version.
2. Effects on PHP 8.2:
On 8th of December , 2022, PHP 8.2 was launched ,two months after Laravel 10 was released. Still, it doesn’t stop you from using PHP 8.2 features, as without doing too much effort, Laravel 10 is set for PHP 8.2.
By the way, the entire Laravel ecosystem, which includes Forge, Vapour, and Envoyer, does support PHP 8.2, and one can even use PHP 8.2 with Laravel 9.
3. What’s new on official Packages ?
This time, all of the official packages and the ecosystem have been professionally updated and maintained on a constant basis, along with the framework.
Official Packages which are most recently updated to support Laravel 10 are:-
This time, all of the official packages and the ecosystem have been professionally updated and maintained on a constant basis, along with the framework.
- Valet
- Dusk
- Passport
- Installer
- Breeze
- Scout
- Cashier Stripe
- Horizon
- Pint
- Sail
- Jetstream
4. Predis Version Upgrade
No longer Laravel will be supporting Predis1 because of the inclusion of Laravel 10; from now on, the framework will only support Predis 2. To provide a smooth user experience , the client for PHP “Redis” which is a robust version of Predis can help you to get the maximum out of caching.
5. Why Native-Type Declaration is Important.
Just to make sure what a piece of code can do and what kind of parameters or responses to expect, Laravel used to employ DocBlocks in its skeleton code. But after native type declarations in the new update,all of this will change.
This change will surely profit the developer experience because IDEs will know the expected shape of parameters and response. The auto-complete features will assist the code editors to execute better.
Even though the documentation of Laravel refers to Predis as the package for linking with Redis, one can also use the official PHP extension, and that extension also leads to an API for communicating with Redis servers.
6. Changes in Invokable validation rules:
Previously, we used to add an invokable flag after the Artisan command in Laravel 9, which is furthermore not needed due to the inclusion of Laravel 10 rules that are invokable by default.
7. The hashing algorithm speeds up:
8. Fixtures in Eager Loading Optimization:
Why are we saying fixtures instead of features? Because it has many more fixes than features.
It tackles ongoing issues within eager loading relations, it creates a huge number of unfeasible queries to be executed.
However, in the new update, it checks to see if any keys are available, and if none are, it allows an empty collection, eliminating the need for any unnecessary database queries.
9. Does Laravel 10 support PHP unit 10?
Yes, it does support PHP unit 10; not only PHP unit 10, it also supports PHP unit 9 and 8 as It’s a framework for unit testing.
10. Security Improvements for Timebox Class:
11. DispatchNow() is taken off:
Let’s see an example in Laravel 10 about executing a job by using the sync queue drive:
// in your job class
public $queue = ‘sync’;
// in your controller or other code
dispatch(new YourJob($data))->onQueue(‘sync’);
Summary:
This blog has included all the top features and improvements of the latest version of Laravel, which is version 10 . After knowing these new features, you might be itching to use this new version, so don’t wait any longer and start building an app with the new Laravel 10 by yourself. Xceltec Developers has been listed on TopDevelopers.co as a top mobile app development company.
Why Choose XcelTec for Laravel App Development?
Get in touch with us for more!
Contact us on:- +91 987 979 9459
Email us at:- sales@xceltec.com
Visit our website: https://www.xceltec.com/