New Features
Predis v2 support: Laravel 10 offers Predis v2 support. This allows you to take advantage of Predis' new features and improvements.
dispatchNow() has been removed: The dispatchNow() function has been deprecated in Laravel 10. Instead, you need to use Job::dispatch().
Removed deprecated methods and features: Laravel 10 removes many deprecated methods and features. This makes Laravel cleaner and more organized.
Callable validation rules by default: Laravel 10 uses callable validation rules by default. This makes validation rules more flexible and useful.
Improvements
Event system improved: Laravel 10 has improved the event system. This allows you to create and listen to events more easily.
Eloquent ORM improved: Laravel 10 has improved Eloquent ORM. This allows you to work with Eloquent more easily.
Artisan commands improved: Laravel 10 has improved Artisan commands. This makes Artisan commands more useful and efficient.
Overall, Laravel 10 is a major release that brings many new features and improvements to the Laravel Framework. This version makes Laravel more powerful, more flexible and more useful.
Predis v2 support
Predis is a PHP library for Redis. Laravel 10 offers Predis v2 support. This allows you to take advantage of Predis' new features and improvements.
Predis v2 includes the following new features and improvements:
New commands: Predis v2 includes the following new commands:
XADD: Used to add one or more values to a hash.
XCLAIM: Used to lock part of a hash.
XTRIM: Used to extract one or more values from a hash.
New syntax: Predis v2 includes the following new syntaxes:
EXISTS syntax is used to check whether a key exists.
TYPE syntax is used to check the type of a key.
New features: Predis v2 includes the following new features:
READ_ONLY mode ensures that a connection allows only read operations.
WRITE_ONLY mode ensures that a connection allows only write operations.
dispatchNow() has been removed
The dispatchNow() function has been removed in Laravel 10. Instead, you need to use Job::dispatch().
The dispatchNow() function was used to run a job immediately. However, this functionality was removed because it could disrupt the order of jobs and cause performance issues.
The Job::dispatch() function is used to run a job on a scheduled or deferred basis. This function helps maintain the order of jobs and improve performance.
Deprecated methods and properties removed
Laravel 10 removes many deprecated methods and features. This makes Laravel cleaner and more organized.
Some of the deprecated methods and features include:
Auth::user(): This method is used to get the user session. Instead, you must use the corresponding protection using the Auth::guard() function.
Route::get(): This method is used to add a route. Instead, you can add a more flexible route using the Route::match() function.
Validation rules callable by default
Laravel 10 uses callable validation rules by default. This makes validation rules more flexible and useful.