Laravel 10: Latest Updates and Features
June 5, 2023
Laravel is already an excellent tool for PHP developers. There’s a misconception out there that has led developers to believe that PHP is now easy to learn. PHP is, therefore, the most accessible programming language. What’s in the Laravel box for Laravel developers, then? Has it exhausted every possible way to support PHP developers or not?
You must also be wondering why we asked you these questions. It’s an excellent surprise for Laravel Developers. Laravel 10 has finally been released on the market.
Introduction To Laravel 10
Before Laravel 9, significant updates are released every six months. The company recently changed the schedule of Laravel releases and now introduces major updates only once a year. Last year Laravel was introduced on 8th Feb 2022. Laravel 10 will be released on 7th February 2023.
Take a look at the critical points in this update:
- Laravel 10 has ended the support for PHP V8
- Laravel 10 removes all deprecated Laravel 9 methods
- The app skeleton now uses native-type declaration in Laravel 10.
- Eager loading optimization
- DispatchNow() can be removed
- You can read more about the new features and deprecations in the future.
Laravel 10 New Update and Feature List
Everyone is interested in learning about the additions to Laravel 10, whether you’re a developer, a business owner, or both. Let’s look at what’s new first!
Laravel Penta is Here
Laravel Pennant, a new addition to Laravel 10, will allow users to quickly roll out more unique features and toggle them on or off during runtime. It will be part of Laravel’s innovative functionality as a lightweight, simplified solution. It has multiple APIs and advanced features, including an ‘array driver’ in memory, A/B interface design, trunk-based development, and a “database driver” for continuous feature storage.
Eager Loading Optimization
In a previous version of Laravel, users were required to run an “N+1 query” to retrieve the answer from lazy-loading. In Laravel 10, this won’t be an issue anymore. Using the Eager Loading Optimizer feature, users can check for any keys available and run database queries without interruption.
It was added to Laravel 10’s updates four days before its release. It used to be intimidating to work with multiple databases. With this addition, you only need to write reliable expressions and statements once. You may have a longer codebase, but you won’t need to repeat it now.
Application Skeleton code with Type Declarations
Laravel used DocBlocks to explain the purpose of a code and the parameters or responses it provides. With the latest Type Declarations, every user code within the framework now features type-hints and returns types. These enhancements provide additional benefits and do not affect the backward compatibility of the core framework. Method arguments, return types, eliminating unnecessary annotations where possible, excluding Types Property, and allowing access to closure arguments are all included.
PHP 8.2 is now supported
PHP 8-2 was the latest release in December 2022. Laravel 10 still supports PHP 8.2 despite its short existence. If you want to use the latest PHP version, you can do so with Laravel 10 Using new and exciting features, such as DNF types, ReadOnly classes, or fetching enum values in const expressions is possible. The PHP 8.1 version will also be supported until 2025. PHP 8.2 is also compatible with Laravel Forge Vapor Envoyer and other technologies within the Laravel ecosystem. If you plan well during development, you will get the most out of a stable PHP version.
Native types instead of Docblocks
The Laravel 10 Skeleton relies on PHPDoc blocks to provide type-hinting instead of native PHP types. It also improves performance because less parsing is required. Using native PHP types allows for better performance and more accurate type-checking. This change is a part of Laravel’s ongoing efforts to modernize the codebase and improve the developer experience.
Hashing Algorithm is Now Faster than Ever
xxHash has a high-speed output with exceptional randomness and dispersion. This helps to reduce collisions. PHP version 8.1 now supports xxh128. This makes it a perfect hash algorithm for Laravel 10, which runs on PHP 8.1. Taylor warned to be aware that third-party packages might rely on the file name format being the same as the SHA-1 algorithm, which was Laravel’s previous hashing method. It is essential that all third-party packages that are used in your application support xxHash.
Timebox class security improvement
Laravel 10 brings security improvements to the Timebox class. These enhancements are designed to protect applications from timeless timing attacks. The hasValidCredentials method uses the Timebox Class. This class includes support for managing errors during a Timebox execution.
Column type Native Retrieval
Laravel 10 brings a crucial feature that minimizes the requirement of relying on the doctrine/dbal package when using the Schema::getColumnType method. This feature allows the database drivers to convert data types directly, which results in faster data processing. The native retrieval feature improves performance and allows you to create integration tests to test the new column modification feature. This feature allows you to retrieve the column type or data type name.
Removed dispatch now
In Laravel 10, the “dispatchNow()” method is no longer available. It was deprecated by Laravel 9 and replaced with “dispatchSync().” The ‘dispatchNow()’ method has been removed in Laravel 10 as it was deprecated in Laravel 9 and replaced by i>’dispatchSync()’/i>.
Laravel is a milestone for PHP users and the PHP community. It has been a landmark for PHP and its users. It is a powerful tool for all developers, whether working on an entry-level project or a large enterprise.
This new release offers developers a chance to adapt and learn new things.
This update offers a wide range of new features and functionalities to help them excel in their development processes. It is now up to the developers to use it according to their business needs.