Laravel 1o New Features is arguably one of the most popular frameworks online for creating web applications based on the PHP programming language. It provides a user-friendly and secure environment for web developers. Above all, Laravel users benefit from a simplified platform to create their applications in reduced time. This framework is equipped with features such as dependency injection, task scheduling, unit test creation, and an expressive database abstraction layer.
Laravel 10 is the latest released version of the Laravel framework. The Laravel development team has announced new features, updates but also deprecations. Continue reading this article as we explore what’s new in Laravel 10 as well as deprecations. Then, we will also see how you can proceed to install this latest version and evolve your project on Laravel.
Support for PHP 8.1 and 8.2.
As you know, Laravel is a framework using the PHP language. For version 10 to work properly, the minimum required PHP version is 8.1. The framework also supports PHP version 8.2 (released around 2 months before the release of Laravel 10), to ensure more performance and security.
But, because all new versions of Laravel released are better designed for backward compatibility, your applications created with versions before Laravel 10 will not be affected in any way.
You can continue to use read-only and array_is_list properties supported in PHP versions 8.1 and 8.2.
Luhoster recommends its hosting plan on sale at -25% (offer from €1.49 per month instead of €1.99). Not only is the performance there, but you also benefit from exceptional support.
Here is an example.
$table->integer(‘user_balance’)->unsigned()->default(0)->comment(‘balance’); // `user_balance` is an integer, unsigned, defaults to ‘0’, and column comment is ‘balance’
In the example above, to change the type of the user_balence column, Laravel 10 allows you to write this code with a more simplified syntax:
$table->bigInteger(‘user_balance’)->change(); // This will change `user_balance` to bigInteger instead of just integer
3. Replacing DocBlocks with native type declarations
Most frameworks use DocBlocks which are formatted comments. These blocks allow you to document specific code segments in your project. This makes it easy to implement different codes of the applications that are created. However, the arrival of Laravel 10 has changed this situation.
Updating the different packages used in Laravel.
To ensure the best compatibility and probably prevent security vulnerabilities in the working environment, most of the packages used in Laravel have also been updated to work with Laravel 10.
Jetstream is used in Laravel to implement features of login, registration, session management, two-factor authentication, email verification and to applications that are designed, etc.
Stripe Cashier: this provides an interface to applications that wish to integrate Stripe subscription services such as coupon management, invoice creation, or even subscription exchange.
Horizon: To easily monitor key metrics of your queuing system, such as job throughput, execution time, and job failures.
Passport: to implement an OAuth2-type server for your Laravel application in just a few minutes.
Dusk: which provides an easy-to-use expressive browser automation and testing API.
But many other packages are also updated such as Breeze, Pint, Valet, and Scout…
. Validation rules are invokable by default.
Laravel 9 users must add the –invokable controller after the Artisan command to make a validation rule invokable. With the release of Laravel 10, you no longer need to use this flag.
Quite simply, the Laravel core team has made all validation rules invokable by default. Therefore, a saves time for developers adept at this PHP framework. So, you can create a validation rule just by writing the code below:
. Improved error handling.
Laravel has also improved the way you handle errors during the development of your projects. Developers can have access to a log, which traces coding errors in the architecture of your application. But, you can also configure the sending of notifications by email for all critical errors.
This is a remarkable change that allows Laravel users to get a head start on managing coding errors and above all accelerate the implementation of projects.
Laravel Process Interaction
Another major change concerns the Laravel Process. Indeed, developers can quickly and easily run tests and CLI commands in the new version. Finally, the functionality will allow you to build and test new processes in a fairly neat way as in this example given by Taylor, the head of the Laravel team:
use IlluminateSupportFacadesProcess;
$result = Process::run(‘ls -la’);
$result->successful();
$result->failed();
$result->exitCode();
$result->output();
$result->errorOutput();
$result->throw();
$result->throwIf(condition);
Fanion Laravel.
Laravel 10 includes flags that allow PHP developers to work on new features of their applications. Laravel Pennant provides an easy-to-use instance for holding flags for new features. This feature is also useful when working on updating existing features.
Laravel Pennant included in Laravel 10, should allow you to manage a large number of flags in your project.
You can use the code below to add new functionality:
use LaravelPennantFeature;
use IlluminateSupportLottery;
Feature::define(‘new-color-button, function () {
return Lottery::odds(1, 10);
How to upgrade an existing project to Laravel.
If you have existing projects and want to upgrade to Laravel 10, you should note that there are some requirements to consider. The central team relies on backward code compatibility so as not to affect previously created applications. However, you should always take into account newly added features and adjust your code by removing functions and classes or methods that have been deprecated.
To help developers, a step-by-step guide is available on the official website on how you should proceed. This story also details possible disruptions that may affect your project during the upgrade.
To prevent outages and easily upgrade your applications, you can use Laravel Shift. This tool automates the process and saves you time when upgrading dependencies and all other necessary components.
Tips and tricks.
At Luhoster, you can install Laravel 10 if you have PHP hosting: shared web hosting, cPanel hosting, cPanel VPS server, or ISPConfig VPS server.
On our cPanel plans, you can install Laravel 10 regardless of the plan you have chosen. To easily and quickly install this PHP framework, you can use our automatic installation tools.
On standard Linux plans, you can use the Luhoster Panel or Softaculous auto-installer on all cPanel plans. It’s faster and less technically demanding.
For example, for a standard Linux plan, Luhoster Starter, log in to your hosting account and open the “Auto-installer” tool. In the resulting interface, scroll down the list of applications and select Laravel among the PHP frameworks presented. Installation will only take a few minutes. On cPanel plans, use Softacoulous and search for Laravel among the different frameworks presented.
Conclusion.
Well done for reading this article until the end, Laravel 10 is now available! 😁 It brings new features, updates and deprecations. In this article, we have gone through these different changes made to Laravel 10, probably the most popular PHP framework. If you have an existing project, we’ve also talked about how to go about upgrading to Laravel 10. We’ve also detailed the process for running a new Laravel 10 installation. Now you know what you need to do!
Related readings.
What are the differences between Laravel and Symfony?
Which hosting plan to choose with the Laravel framework?
If you have any additions suggestions or questions on how to deploy a Laravel 10 project on our servers, do not hesitate to write to us using the Comments section.
Luhoster recommends its WordPress hosting plan on sale at -20% (offer from €3.99 per month instead of €4.99). Not only is the performance there, but you also benefit from exceptional support.
Discover the offer.
Laravel is arguably one of the most popular frameworks online for creating web applications based on the PHP programming language. It provides a user-friendly and secure environment for web developers. Above all, Laravel users benefit from a simplified platform to create their applications in reduced time. This framework is equipped with features such as dependency injection, task scheduling, unit test creation, and an expressive database abstraction layer.
Laravel 10 is the latest released version of the Laravel framework. The Laravel development team has announced new features, updates but also deprecations. Keep reading this article as we explore what’s new in Laravel 10 as well as deprecations. Then, we will also see how you can proceed to install this latest version and evolve your project on Laravel 10.