Laravel 10 Release Date

 

According to the Semantic Versioning technique, which is used by Laravel and its first-party packages, the framework's main updates are released once a year in the first quarter. Minor changes may, however, be made available as required. The newest iteration of the framework, Laravel 10, is arrived and boasts exciting new features and changes. It will be available on February 13, 2023. Every six months, a new Laravel version was previously published. The core team switched to an annual release cycle, as shown below, but, following the release of Laravel 9 in February 2022:

๐ŸŸ  Laravel 9: February 8, 2022,

๐ŸŸ  Laravel 10: February 13, 2023,

๐ŸŸ  Laravel 11: February 6, 2024

Laravel 9 will receive scheduled bug patches through August 8, 2023, and security fixes through February 6, 2024, according to the official Laravel News Page. Up until August 6, 2024, and up until February 4, 2025, respectively, Laravel 10 is anticipated to receive bug fixes and security updates.

 

Whatโ€™s New in Laravel 10: Latest Features and Updates

It is advised to use version limitations like "10.0" when referring to the framework or its components in an application or package because the core team behind it is constantly striving to improve what is available to users. This is due to the possibility that later versions will have notable additions and modifications. There are numerous significant enhancements in the most recent version of Laravel 10, which will help product owners. Let's examine these modifications more closely:

 

๐ŸŸ Template Engine

Laravel is well known due to its lightweight, built-in templates that are used to create attractive layouts with dynamic content seeding. Laravel offers a large selection of widgets that combine JS and CSS. The templates were ingeniously designed to generate composite layouts that are straightforward for developers to work with.

 

๐ŸŸ Artisan Command Becomes More Interactive


 

With the most recent Laravel 10 version, the CLI (Command Line Interface) named Artisan has grown more interactive. With the new Artisan, you may pass the name even if you forget after building a model.

php artisan make: model

If Artisan is unable to retrieve a model name, it won't display any errors. As opposed to that, it will ask you what it is called and whether you want to construct a factory, migrate, etc.

Invokable Validation Rules by Default

An object that can be referred to as a function in PHP is an "invokable" object. This can be done by calling the magic method __to invoke in the object class definition.

Laravel 9 was offering invokable validation rules using --an invokable flag with php artisan make: rule command.

When an object is used in a situation where a function call is anticipated, such as using () operator, the __invoke method is immediately enabled. When a function is called on an object that has a __invoke method, PHP will automatically run the code inside of that method.

php artisan make: rule LowerCase

Let's see what invokable validation rules look like:

namespace App\Rules;


 

use Illuminate\Contracts\Validation\InvokableRule;

class Uppercase implements InvokableRule

{

/**

* Run the validation rule.

*

* @param string $attribute

* @param mixed $value

* @param Closure(string): Illuminate\Translation\PotentiallyTranslatedString $fail

* @return void

*/

public function __invoke($attribute, $value, $fail)

{

if (strtolower($value) !== $value) {

$fail('The :attribute must be lowercase.');

}

}

}

 

The boilerplate code is far shorter and easier to read. Laravel 10 will make people less afraid of the idea of developing unique validation rules.

Check out the pull request here on GitHub: [10. x] Default to invokable rules

Scale up Your Digital Goals with Our Cutting-Edge PHP Development Solutions


 

๐ŸŸ  PHP 8.0 Support Dropped

 

PHP 8.0 is no longer supported by Laravel 10, so you should upgrade to PHP 8.1 or 8.2. But it's not required to upgrade your Laravel applications right away after they're released to the most recent version of Laravel. However, extensive testing is still advised, especially for tasks involving paid customers or workers. In addition, Predis v1 support has been phased down along with PHP 8.0, thus you must upgrade to Predis v2.

 

๐ŸŸ  Introduced Laravel Pennant

 

The Laravel Pennant is an easy-to-use and compact feature flag package that makes adding new features to your application simple. It supports trunk-based development techniques, has an A/B test interface design, and more. The feature flags enable the at-runtime feature on/off without modifying the code.

 

๐ŸŸ  Easy Process Handling

 

You can quickly execute external processes in your Laravel application thanks to the clear and comprehensive Symphony Process API that Laravel provides. With this process functionality, frequent use cases are addressed, greatly enhancing the development experience.

 

๐ŸŸ  Invokable Validation Rules by Default

 

When generating a new Invokable rule with Laravel 9, the -invokable flag had to be included after the artisan command. To create a new Invokable rule, however, you may simply issue the following command in Laravel 10:

php artisan make: rule CustomRule

Furthermore, because the boilerplate code is clear and simple to understand, it is less frightening for developers to write their unique validation criteria.

 

๐ŸŸ  Application Skeleton Code with Type Declarations

 

Formerly, Laravel used DocBlocks in its skeleton code to explicitly describe the purpose of a specific code and the results or parameters it returns. However, all user scripts within the framework now provide type-hints and return types thanks to the most recent Type Declarations. These improvements provide extra advantages and don't affect the backward compatibility of the main framework. Included in this are Method Arguments, Return Types, the removal of superfluous Annotations when practical, the exclusion of the Types property, and the availability of Closure Arguments to Users.

 

๐ŸŸ  Removed dispatchNow()

 

The 'dispatchNow()' method, which was deprecated in Laravel 9 in favor of 'dispatchSync(),' has been removed in Laravel 10. As it is a breaking change, you must replace it in all of your current projects. Fortunately, the fix is straightforward.

 

๐ŸŸ  Deprecations from Laravel 9

 

With the most recent Laravel version, the team is gradually removing outdated methods from the Laravel 10 branch that existed in Laravel 9. A list of all deprecated methods and packages, as well as an update to the Laravel documentation on the upgrade procedure, can be found there. To get the desired result, those who intend to convert their applications to Laravel v10 will need to rebuild their code using a new methodology. Deprecations and deletions from version 9 to the master branch include the following:

  • The Route::home method, which was deprecated in Laravel 9
  • The getBaseQuery method, which has a base equivalent
  • The MaintenanceModeException class is no longer in use
  • The MocksApplicationServices trait
  • The Mail::failures method in the mail fake
  • A recommendation to use $casts instead of the deprecated $dates property
  • The assertTimesSent() method
  • Support for Predis 1 and doctrine/dbal 2 are no longer available
  • All related deprecations in doctrine/dbal since Laravel have dropped support for version 2.

 

Should You Upgrade to Laravel 10?

 

It's crucial to keep in mind that we don't always have to update the Laravel version of our application to the most recent version as soon as a new version is available.

As Laravel is an open-source framework, we automatically become the owners of the framework's codebase each time we install a new Laravel instance on our computer. This implies that our app will continue to function even if the framework version it uses is no longer maintained; we will merely need to maintain it ourselves.

As a result, it is widely suggested that application stability be prioritized over framework upgrades.

In short, you should consider upgrading to Laravel 10 when:

  • The application is stable with its current version and functioning without problems.
  • The new version either adds a feature that your application requires or fixes an issue that your application is experiencing.
  • The application will be well-tested before the upgrade changes are pushed into production.


 

How to Upgrade from Laravel 9 to Laravel 10

 

Laravel 10.x Shift makes it simple to upgrade your existing Laravel application to the new version following the official release of Laravel v10. By automating the upgrade from Laravel 9 to Laravel 10, this tool can help you save up to two hours of productive time. It's crucial to remember that Laravel and Laravel 10.x Shift will both get frequent upgrades, and Shift users can ask for a rerun if necessary.

 

๐ŸŸ  Requirements

 

To upgrade your current Laravel application to Laravel 10, a few essential requirements must be met:

  • Your Laravel application must be on Laravel 9 or above
  • Your server must have PHP 8.1 or a higher version installed.

 

๐ŸŸ  Core Upgrades

 

The Shift automates many of the upgrades outlined in the Laravel Upgrade Guide, including-

  • Upgrades to the core project files of Laravel
  • New methods for changes made to interfaces
  • Addition of PHP-type hints to the Laravel app
  • Conversion of the deprecated $dates property to $casts
  • Update of core dependencies for Laravel 10 and PHP 8.1
  • Removal of redundant typing within PHP DocBlocks
  • Detection of deprecated code within the app code.

 

๐ŸŸ  Additional Upgrades

 

Along with the core upgrades, the Shift also provides additional upgrades mentioned in the Laravel Upgrade Guide, such as:

  • Modernization of PHP syntax, including the use of the null safe operator and short arrays
  • Ability to apply your preferred code style
  • Adoption of tuple syntax and class-based routes
  • Conversion to anonymous migrations
  • Automated changes required for PHPUnit 9
  • Transformation of Faker property access to method calls
  • Updates to config files to reflect the Laravel 10 versions
  • Increased dependency constraints for popular packages.

 

๐ŸŸ  Manual Upgrades

 

While the Laravel 10.x Shift strives to automate as many upgrades as feasible, but it's conceivable that some updates cannot be done so. When this happens, it notices the updates and gives thorough guidance in the form of pull request comments that outline the necessary steps for manual implementation.

Despite the Shift's best efforts, a manual implementation may still be necessary to identify and manage upgrades for common dependencies. To guarantee a successful upgrade, it is advised to check the changelog for dependencies and any extra changes.



 



Contact Us logo Whatsapp