What’s New in Laravel 10? Know All About it!
If you are all excited about Laravel’s new version release, this blog is for you! This is also for those who are wondering if it’s worthwhile to use PHP Laravel in 2023! Here, you will get some great news… read on to find it out.
We will briefly delve into the significance of the PHP programming language and the Laravel framework in detail. We will also explore the newly released Laravel 10 and the features it offers. In short, you will get to know what major changes and features are brought about by the latest Laravel 10 version.
Why PHP Laravel?
PHP is a popular general-purpose language powering 78.9% of websites. This open-source scripting language is a preferred choice among programmers and web developers as it helps create dynamic content and effectively interact with databases. Even in the midst of a plethora of newer languages, it's extensively used and supported by a large community of developers thanks to its simplicity, speed, and flexibility.
When it comes to choosing the best open-source web development framework, Laravel scoops out one of the top positions. It has the versatility to build high-performing applications and hence is touted as the best PHP framework for developing robust web applications.
Here are some of the top websites and apps built with Laravel: Laravel.io, Asgard CMS, October CMS, Alison, Invoice Ninja, etc.
A Quick Look Back at Laravel
This powerful open-source PHP framework was developed and created by Taylor Otwell. The first beta release of Laravel was made available on June 9, 2011. The release of Laravel 1 (Laravel Spark) ensued later in the same month. It was introduced as a first-rate substitute for CodeIgniter. It gained instant popularity thanks to its superior scalable features, clean syntax, and tools for tasks such as routing and authentication.
The Laravel framework has made strides since its initial release. It grew by evolving and enhancing with new features. With new versions and features being released annually, it has become a popular and dependable framework for PHP developers. (Release of major versions used to happen every 6 months. But they changed it to an annual affair to relieve their community and development team from the maintenance burden.)
Why Laravel?
- Artisan, its versatile command line interface routinely completes numerous repetitive tasks and thus saves developers’ time and effort.
- It has the ability to integrate with a valid token form or an AJAX call.
- Anyone with a general understanding of PHP and object-oriented programming (OOP) concepts can quickly learn Laravel
- Laravel has a wide assortment of online documentation and online learning resources
- It offers diverse tools for developers at all expertise levels
- Laravel functions as a brilliant PHP authentication framework by configuring everything well, implementing authentication and authorization very effortlessly and securely
- It guarantees a high level of security through an incredibly advanced codebase
What’s New in Laravel 10?
Laravel 10 comes with some additional new features as in every release. You can consider upgrading to this new version if your application requires some additional features or needs some fixes.
1. PHP 8.1 is the minimum required version
Laravel 10 framework will no longer support PHP 8 (<=v8.0). It sets PHP 8.1 as the minimum mandatory version. It holds certain PHP 8.1 features such as readonly properties and array_is_list.
2. Support for PHP 8.2
It’s a piece of good news for the users of PHP 8.2 versions (released recently in Dec 2022) that the entire Laravel ecosystem supports all its features.
3. Application Skeleton Code Will Have Native Type Declarations
It has introduced argument and return types to all method signatures by meticulously updating the application skeleton and all stubs. It has also done away with the superfluous "doc block" type-hint information.
This change enhances the developer experience. It offers a better type of clarity that is impossible through PHP native types. Moreover, prevailing applications needing these type-hints will continue to function normally as it does not break the backward compatibility with existing applications.
4. Laravel Pennant: An easy-to-use solution for maintaining feature flags
Laravel Pennant, developed by Tim MacDonald, is a “simple and lightweight feature flag package - without the cruft”. This reorganized approach to managing your application's feature flags facilitates the incremental rolling out of new features with confidence (Features can be easily defined via the Feature::define method.
Developers will also be able to A/B test new interface designs, complement a trunk-based development strategy, and a lot more.
Pennant also comes with an in-memory array driver and a database driver for continuous feature storage.
5. All Validation Rules Invokable by Default
You no longer need to add an --invokable flag after the Artisan command to make an invokable validation rule (this was required in Laravel 9). The reason is that all Laravel 10 rules are invokable by default. You can create a new invokable rule in Laravel 10 by running the following command:
php artisan make:rule CustomRule
6. Process Facade
A new Process abstraction level or façade is added to Laravel 10. The Process Interaction level by Nuno Maduro and Taylor Otwell enables the execution and management of concurrent processes easily and makes interaction with external processes easy.
7. Official Packages Gets a Boost
Laravel’s official packages, the primary way of adding functionality to Laravel, have also received a facelift as part of the recent framework upgrade. The official packages and the ecosystem that have been updated are Breeze, Cashier Stripe, Dusk, Horizon, Installer, Jetstream, Passport, Pint, Sail, Scout, and Valet.
8. Horizon & Telescope Receives a Facelift
Horizon - the Laravel package to manage Laravel-powered Redis queues, and Telescope - a debugging assistant for the Laravel framework have received a fresh and updated look with enhanced typography, spacing, and design.
9. New Password Helper
Laravel 10 comes with a new password helper to generate secure passwords. The new helper Str::password() will generate a secure, random password of the necessary length (32 characters long) combining letters, numbers, symbols, and spaces.
10. Test Profiling to find slow tests
Nuno Maduro has contributed Test Profiling to the Artisan test command. The new profile option helps in effortlessly finding the slowest tests in your application (php artisan test –profile), which will be displayed directly within the CLI output. This new addition makes your tests faster by fixing slow tests or grouping them.
Wrapping Up
So, folks, that is about the major features of the newly released Laravel 10. Please check out the official release page to get more insights into the updates.
We can confidently say that the Laravel team has taken genuine efforts in bringing out major changes without affecting previous development. It has taken care of developers who are still working on Laravel 9. They get adequate time to migrate to Laravel 10.
Let’s stay tuned for the next version upgrade in 2024.
Meanwhile, are you looking for skilled open-source developers with versatile experience in PHP and Laravel? You can hire highly-skilled dedicated remote developers to fulfill your project requirements in time. Schedule a call now.