What is New in Laravel 10: Explore New Features and Updates

When you’re making a new website or app, one big decision is picking the right tool that makes sure to have everything you need. Check boxing the same; Laravel development has been signifying itself as a mega star in the world of creating websites.

Building a strong, flexible, and easy-to-maintain web application is a standard requirement for anyone seeking such development assistance. That’s where Laravel comes in! Laravel is a most helpful and complete guide to building a web application.

Since the launch year of 2011 by Taylor Otwell, comparing other PHP frameworks, Laravel has been adapted by developers more quickly and efficiently. 

It doesn’t matter if you’re a pro coder or just a Laravel beginner – with clear instructions and documentation, Laravel makes building web applications fairly easy.

Laravel framework helps people write code quickly and neatly. It’s got lots of handy features like a tool for working with databases, a way to manage who can access the site, and tools for doing common tasks like sending and storing data.

New Features and Updates in Laravel 10

There’s no doubt that the most exciting part about any new release is the new features, which was Laravel v9 by the time of January 2022. Further, while already having thousands of users, Taylor Otwell launched Laravel v10 in Feb – 2023.

Let’s move ahead and have a look at the Laravel 10 new features and updates in:

Minimum Requirement of PHP 8.1

Considering the use of Laravel v10 will need a minimum of PHP 8.1, to ensure improved performance, type safety, and long-term support. Some features, including read-only properties and array_is_list, have also been considered in use.

Offers Support for PHP Version 8.2

As PHP 8.2 was released just two months before the Laravel 10 release date – it is suggested to consider integrating it and using each of all its features. Also, you don’t need to go any extra mile doing so; Laravel 10 is ready for PHP 8.2.

In fact, the entire Laravel ecosystem, including Laravel Pennant, Vapor, and Laravel Breeze, supports PHP 8.2, and can even use PHP Version 8.2 with Laravel 10.

Official Laravel Packages Upgrade

Particularly, not only is Laravel framework version 10 a professionally maintained and updated collection of code, but each official package included in the entire ecosystem is also.

Below, we have mentioned the list of the most official Laravel packages that have been precisely updated to support the latest version, i.e., Laravel 10:

Laravel PackagesDescription
1. BreezeA simple, minimal Laravel authentication scaffolding, including login, registration, password reset, and email verification.
2. EnvoyerA zero-downtime deployment platform for Laravel applications, ensuring no interruption to users during updates.
3. HorizonA configuration-driven dashboard to monitor key metrics of Laravel-powered queues, providing insights into job throughput, runtime, and failures.
4. Cashier Stripe: An expressive, fluent interface to Stripe’s subscription billing services, making it simple to handle billing directly within Laravel applications.
5. DuskAn end-to-end testing tool for Laravel applications that allows browser testing and interaction without a JavaScript testing framework.
6. InstallerA command-line tool for quickly installing Laravel and its applications, streamlining the setup process.
7. PassportAn OAuth2 server implementation for Laravel that makes API authentication simple and straightforward.
8. PintLaravel’s official PHP code style fixer, ensuring consistent coding standards across Laravel applications.
9. JetstreamA beautifully designed application scaffolding for Laravel that includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.
10. SailA lightweight command-line interface for interacting with Laravel’s default Docker development environment, simplifying Docker management tasks.
11. ScoutA driver-based full-text search solution for Eloquent models, making it easy to add simple search capabilities to Laravel applications.
12. ValetA Laravel development environment for macOS minimalists, serving as a fast, minimal no-configuration development environment for Laravel developers.

Laravel Pennant

It is A new first-party package created by the Laravel team that gets included within the Laravel v10 installation. Laravel Pennant offers a lightweight, streamlined approach to managing Feature Flags of your web application.

These Feature flags enable the Laravel developer to incrementally roll out new application features, including A/B test new interface designs, complement the trunk-based development strategy, and many other additional functionalities.

Being in the latest line up, the official package of Laravel Pennant is well-functionalized and precisely tested by the core Laravel team itself.

In this, features can also be easily defined via the ‘Feature::define‘ method:

use Laravel\Pennant\Feature;
use Illuminate\Support\Lottery;
Feature::define('new-onboarding-flow', function () {
    return Lottery::odds(1, 10);
});

After a feature has been defined, you may also easily determine if the current user has access to the given feature or not:

if (Feature::active('new-onboarding-flow')) {
    // ...
}

For convenience, Laravel Pennant also offers Blade directives:

@feature('new-onboarding-flow')
    <div>
        <!-- ... -->
    </div>
@endfeature

That’s not all! This Pennant included in the Laravel version also offers a bulk of much more advanced features and APIs. 

Now, such terms can turn into higher complexities as you dive more – if you are working on a small-scale Laravel app, then assistance from dedicated Laravel developers will definitely work out for you. 

But if your Laravel application includes a complex architectural structure and needs to be completed within a short timeline, then staff augmentation is better.

Process Interaction

Laravel v10 has also introduced an enhanced abstraction layer for starting and interacting with external processes via a new Process facade.

use Illuminate\Support\Facades\Process;
$result = Process::run('ls -la');
return $result->output();

Process Interaction is basically an added new feature in Laravel v10 that enables the developer to work seamlessly with external processes in a more streamlined and efficient manner. It may even be started in pools, allowing for the convenient execution and management of concurrent processes:

use Illuminate\Process\Pool;
use Illuminate\Support\Facades\Process;
 
[$first, $second, $third] = Process::concurrently(function (Pool $pool) {
    $pool->command('cat first.txt');
    $pool->command('cat second.txt');
    $pool->command('cat third.txt');
});
 
return $first->output();

It also provides the ability to run shell commands within the web application, send input to the processes, and receive output from them immediately.

This feature can be extremely useful for tasks like running system commands, interacting with other software, or executing background processes.

In addition, processes may be faked for convenient testing:

	Process::fake();
// ...
Process::assertRan('ls -la');

For more information on interacting with processes, a personalized 1:1 consultation with dedicated Laravel developers or experienced PHP developers in the Laravel framework is crucial.

Test Profiling

The — profile is the new flag added to the Artisan test command that was contributed by Nuno Maduro. It lets you quickly identify the slowest tests in your web application (php artisan test –profile).

It will be directly displayed within the CLI output. This new feature benefits faster tests by fixing slow tests and grouping them.

php artisan test --profile

Pest Scaffolding

When you create a new Laravel project, you can now include Pest test scaffolding by default. Basically, the Pest is a lightweight testing framework that benefits by simplifying the testing process and making the snippets more readable and enjoyable.

With Pest Scaffolding, Laravel developers will be able to generate new Pest tests and use them in the way they want without doing any additional configurations.

Laravel v10 includes this feature by default. To do so, all you need is to just use the –pest flag when you’re creating the project with the Laravel installer.

Scaffolding with Breeze (to add an authentication feature) can also be achieved by adding the — breeze flag and so forth as per the project requirement.

laravel new example-application --pest

Generator CLI Prompts

To improve the framework’s developer experience, all of Laravel’s built-in make commands no longer require any input.

These Generator CLI prompts enable developers to generate code interactively and scaffolding for multiple web application components. It includes elements such as controllers, models, migrations, and many others.

It also benefits developers to generate code as per their specific needs. For example, when generating a model, a Laravel developer can specify the table name, fields, and data types interactively.

By using Laravel’s built-in prompts, a consistent code structure can ensure a naming convention throughout their application. This consistency can improve code readability and maintainability.

If the commands are invoked without input, you will be prompted for the required arguments:

php artisan make:controller

Why Move to Laravel v10 from Laravel v9?

There are several reasons that are important for maintaining a standard web application structure. You can consider a few mentioned below:

1. Compatibility

As the PHP version and other web technologies evolve, older versions of Laravel may become less compatible with the latest PHP versions, web servers, and databases. 

Using the latest version of Laravel ensures that your web application remains compatible with the broader technology ecosystem.

2. Easier Upgrades

Staying up to date with Laravel releases will make upgrading to the next version usually a smoother process. Delaying upgrades to older versions may result in a more complex and time-consuming upgrade process when you eventually decide to update.

3. Bug Fixes

Laravel releases regularly include bug fixes to address issues and enhance the stability of the framework. Sticking with an older version may mean working with known bugs resolved in newer releases.

4. Performance

No matter whether you are considering the use of Laravel for web applications, mobile app development, or SaaS development, each of these framework releases comes with performance improvements and optimizations. 

Using the latest version can lead to better response times and overall improved application performance, which is important for providing a smooth user experience.

5. Security

Newer versions of Laravel often include security updates and patches to address vulnerabilities and emerging threats. Using an older version may expose your web application to security risks that have already been addressed in newer releases.

6. Community Support

The Laravel community and its ecosystem are vibrant and active. Community support, documentation, and resources are typically focused on the latest Laravel releases. Using an older version may limit your access to community support and resources.

7. Long-Term Viability

Laravel v10, like many other modern frameworks, is actively maintained and developed. The latest version ensures that your web application remains viable and relevant in the long term and benefits you from ongoing improvements and updates.

Wrapping overall Laravel 10 improvement, there are many other technical advancements this framework’s latest version offers which you can consider while moving from Laravel v9 to Laravel v10:

8. Horizon and Telescope

The two most important elements of the Laravel framework package got an improved interface. The enhancement includes typography, spacing, design, dashboard, and code-driven configuration for Laravel-powered Redis queues

Where Laravel Telescope creates a wonderful companion to the local Laravel development environment, Horizon enables the key monitoring functionalities with the help of which you can easily analyze the queue, such as job throughput, runtime, and failures.

9. Better Error Messages

Aiding the Laravel developers to identify and resolve type-related issues in their code. If you have multiple forms on a single page for each specific error message, having a MessageBag is crucial as it contains an exact validation error.

Version 10 of Laravel also offers the creation of custom error messages that a validator instance can use instead of the default error messages provided by Laravel. 

There are several ways to do so, but the first thing you can do is to pass custom messages as a third argument to the Validator::make method.

10. Support for MongoDB

You read that just right! In fact, using MongoDB with Laravel has become a popular choice after the release of version 10. 

Including improved model serialization and query builder functionality, the Laravel community has made it easier for developers to work with MongoDB in their Laravel applications.

11. Help with Testing

The new feature added in Laravel v10; assertSessionHasInput enables developers to easily check for the presence of specific form inputs in a response, providing more clarity and accuracy in tests.

Also, the withoutMiddleware method in testing API endpoints empowers to test their API routes more easily, without the interference of middleware.

12. Easier Deployment

By default, Laravel v10 provides the inclusion of environment variables in the config: cache command, making the application deployment process easier for the developers. All configuration is included in the cached file.

Discover how we can elevate your project with latest Laravel version!

How to Install Laravel 10?

We’ve mentioned two ideal methods to install Laravel right below, depending on your preference you can choose any of them:

Using the official Laravel installer:

laravel new hello-world

Using Composer Explicitly:

composer create-project --prefer-dist laravel/laravel hello-world

FAQs About New Features and Changes in Laravel v10

Is Laravel 10 stable?
The estimated time given by the Laravel community for bug fixes is August 6, 2023, and fixes of security walls till February 4, 2025. Yet, following the Laravel 9 improvements, the Laravel v10 is well-maintained to be considered for development purposes. Conclusion
How to start Laravel 10?
  • Install PHP 8.1 or Later on your PC.
  • Download and Install Composer on your PC.
  • Create a Laravel 10 application using Composer.
  • Start your Laravel application.
  • Navigate to the homepage of your Laravel application.
How to Make an API in Laravel 10?
  • Create a new Laravel project.
  • Configure the database.
  • Make a model and migration.
  • Migrate to the database.
  • Perform database seeding.
  • Create the controller.
  • Create the routes.
  • Run Laravel API application.
  • Conclusion

    Laravel 10 is a significant release that includes a number of new features and updates that make it easier and more powerful to build web applications.

    If you are currently using or managing a Laravel application, we recommend considering an upgrade to Laravel 10 at your earliest convenience.

    Should you encounter any technical challenges during this process, please don’t hesitate to reach out to us for assistance. Our team consists of highly skilled Laravel developers who are all set to lend their expertise and support.

    To unlock the full potential of latest Laravel version for your business

    author
    Mayur Upadhyay is a tech professional with expertise in Shopify, WordPress, Drupal, Frameworks, jQuery, and more. With a proven track record in web development and eCommerce development.

    Leave a comment