laravel 10

Laravel 10 Released: A Game-Changing Update for Web Developers

Laravel 10 is released on 14 February 2023. It comes with various new features and improvements to existing functionality, which makes building scalable, secure, and high-quality applications easier than ever before. Whether you’re a Laravel developer or just starting, It is worth checking out.

Starting from now, Laravel will have one major release every year, with the following schedule:

  • Laravel 9: released on February 8th, 2022.
  • Laravel 10: released on February 14th, 2023.
  • Laravel 11: to be released in the first quarter of 2024.

Now Laravel 10 doesn’t support PHP 8.0

The framework will no longer provide support for PHP versions less than 8.0. The minimum PHP version required to run Laravel 10 will be PHP 8.1 or higher.

Application skeleton code

The Laravel application skeleton code will include native-type declarations. This means that any user-generated code will have type hints and return types. We believe this change will be beneficial for new projects and make development more efficient.

To ensure backward compatibility at the framework level, it will implement PHP’s latest type-hinting features in a non-disruptive manner. The following changes will be introduced:

  1. Return types will be supported.
  2. Method arguments will be type-hinted.
  3. Redundant annotations will be removed where possible.
  4. User-defined types will be allowed in closure arguments.
  5. Typed properties will not be included.

String Password Helper

You can use the Str::password method in Laravel to create a random, secure password of a specified length. The generated password will contain a mixture of letters, numbers, symbols, and spaces. By default, the length of the password is set to 32 characters.

To use the Str::password method, you need to include the Illuminate\Support\Str class in your code. Here are some examples of how to generate a password:

use Illuminate\Support\Str;

// Generate a 32-character password
$password = Str::password();
// Example output: 'EbJo2vE-AS:U,$%_gkrV4n,q~1xy/-_4'

// Generate a 12-character password
$password = Str::password(12);
// Example output: 'qwuar>#V|i]N'

Deprecations from Laravel 9

Laravel 10 removes some of the methods and functionalities marked as deprecated in Laravel 9. Here are some of the deprecations that have been identified by comparing the Laravel framework’s master branch to the 9. x branch:

  1. Pull Request #41136: removing various deprecations.
  2. Pull Request #42587: removing the deprecated dates property.
  3. Pull Request #42590: removing the handleDeprecation method.
  4. Pull Request #42592: removing the deprecated assertTimesSent method.
  5. 419471e: removing the deprecated $defaultName property in ScheduleListCommand.
  6. Pull Request #42614: removing the deprecated Route::home method.
  7. Pull Request #42591: removing the deprecated dispatchNow functionality.

Invokable Validation rules are the default

If you create a new validation rule via artisan in Laravel 10, you should expect invokable validation rules to be set as the default option.

# Laravel 9 creates a rule class that implements the
# Illuminate\Contracts\Validation\Rule interface
artisan make:rule Uppercase
 
# Laravel 9 flag to create an invokable and implicit rule
artisan make:rule Uppercase --invokable
artisan make:rule Uppercase --invokable --implicit
 
# Laravel 10 creates an invokable rule by default
artisan make:rule Uppercase
 
# Laravel 10 implicit rule
artisan make:rule Uppercase --implicit

How to upgrade from Laravel 9 to Laravel 10

If you’re looking to upgrade your Laravel application from version 9 to version 10, the good news is that it can be done easily with Laravel 10.x Shift. This tool is designed to automate the upgrade process and can save you up to two hours of valuable time. It’s worth noting that both Laravel and Laravel 10.x Shift will receive regular updates, and you can request a rerun if necessary.

Before you upgrade, there are a couple of essential requirements that you should be aware of. Firstly, your current Laravel application must be running on version 9 or a more recent version. Secondly, your server needs to have PHP 8.1 or a higher version installed to support Laravel 10.

In the end

Overall, Laravel 10 is a significant step forward for the popular PHP framework, with several important improvements that make it easier than ever to build high-quality, robust web applications. If you need support or have any questions, please feel free to contact us here

Go To Top