Laravel 11 Now Available - The Laravel Blog (2024)

Today, we're thrilled to announce the release of Laravel 11 and Laravel Reverb.

Laravel 11 Now Available - The Laravel Blog (1)

As we announced at Laracon EU, Laravel 11 introduces a minimal application structure, using SQLite by default, implementing health routing, offering per-second rate limiting, supporting graceful encryption key rotation, improving queue testing, introducing new Artisan commands, adding Resend mail transport, integrating Prompt validator, and more. Check out our Founder and CEO, Taylor Otwell, live demonstrating what's new in Laravel 11:

Laravel 11 Now Available - The Laravel Blog (2)

Reverb is the latest addition to the Laravel ecosystem and is a first-party, scalable WebSocket server that has been introduced to provide robust real-time capabilities to your applications.

To get all of the juicy details about this release, check out our official release notes and upgrade guide. Below, we'll cover some of the highlights.

Laravel 11 introduces a minimal application structure for new Laravel applications, without requiring any changes to existing applications. The new application structure is intended to provide a leaner, more modern experience, while retaining many of the concepts that Laravel developers are already familiar with.

The app folder has been massively simplified; both the HTTP and Console kernels have been removed. The nine middlewares that were rarely customized have now been moved into the framework itself, the exception handler has been removed, and the Providers directory has been streamlined to a single provider.

Here is what the new app folder looks like:

Laravel 11 Now Available - The Laravel Blog (3)

Rest assured, customization remains a priority. To adjust the high-level application behavior settings, you can utilize the revitalized bootstrap/app.php file. This file allows you to modify your application's routing, middleware, service providers, exception handling, and more:

Laravel 11 Now Available - The Laravel Blog (4)

In addition, the routes folder has been simplified; the api.php and channels.php route files are no longer present by default, since many applications do not require these files.

Laravel 11 Now Available - The Laravel Blog (5)

Instead, they can be created using simple Artisan commands:

php artisan install:apiphp artisan install:broadcasting

And there's more! There are numerous details about Laravel's new application structure that we can't cover in this blog post. Make sure to check out our release notes to learn everything about it.

Laravel Reverb brings blazing-fast and scalable real-time WebSocket communication directly to your Laravel application, and provides seamless integration with Laravel’s existing suite of event broadcasting tools, such as Laravel Echo.

Futhermore, Reverb supports horizontal scaling via Redis's publish / subscribe capabilities, allowing you to distribute your WebSocket traffic across multiple backend Reverb servers all supporting a single, high-demand application.

Here is an example of a stress test with ~30,000 clients maintaining open connections to Reverb, where each connection is subscribed to 10 different channels, and more than 6,000 messages are being exchanged per second:

Laravel 11 Now Available - The Laravel Blog (6)

Additionally, you may monitor the performance of your Reverb servers in Laravel Pulse to get a better understanding of the number of connections and messages being handled. To dig deeper into Laravel Reverb, please consult the complete Reverb documentation.

By default, new Laravel applications use SQLite for database storage, as well as the database driver for Laravel's session, cache, and queue. Furthermore, creating a project using composer create-project command or through the Laravel Installer will automatically create the SQLite file and run the initial database migrations for you:

Laravel 11 Now Available - The Laravel Blog (7)

This allows you to begin building your application immediately after creating a new Laravel application, without being required to install additional software or create additional database migrations.

New Laravel 11 applications include a health routing directive, which instructs Laravel to define a simple health-check endpoint that may be invoked by third-party application health monitoring services or orchestration systems like Kubernetes. By default, this route is served at /up:

Laravel 11 Now Available - The Laravel Blog (8)

When HTTP requests are made to this route, Laravel will dispatch a DiagnosingHealth event, allowing you to perform additional health checks relevant to your application, such as verifying database connectivity and ensuring the cache is working as expected.

Previously, attempting to test that a queued job was released, deleted, or manually failed was cumbersome and required the definition of custom queue fakes and stubs. However, in Laravel 11, you may easily test for these queue interactions using the withFakeQueueInteractions method:

Laravel 11 Now Available - The Laravel Blog (9)

Besides the assertReleased assertion, which you can use to verify if a job was released back into the queue, you may also use the assertFailed or assertDeleted assertions to determine if a job has failed or been deleted, respectively.

Since Laravel encrypts all cookies, including your application's session cookie, essentially every request to a Laravel application relies on encryption. However, because of this, rotating your application's encryption key would log all users out of your application. In addition, decrypting data that was encrypted by the previous encryption key becomes impossible.

Laravel 11 allows you to define your application's previous encryption keys as a comma-delimited list via the APP_PREVIOUS_KEYS environment variable:

Laravel 11 Now Available - The Laravel Blog (10)

When encrypting values, Laravel will always use the "current" encryption key, which is within the APP_KEY environment variable. When decrypting values, Laravel will first try the current key. If decryption fails using the current key, Laravel will try all previous keys until one of the keys is able to decrypt the value.

This approach to graceful decryption allows users to keep using your application uninterrupted even if your encryption key is rotated.

For more information on encryption in Laravel, check out the encryption documentation.

There are so many more improvements and new features in Laravel 11 that we can't cover in this post:

  • Per-second rate limiting
  • Resend mail transport
  • Prompt validator integration
  • New Artisan commands
  • Model Casts Improvements
  • The once function
  • Improved Performance When Testing with In-Memory Databases
  • Improved Support for MariaDB
  • And more...

We encourage you to check out the release notes and upgrade guide for more information on the new features and improvements in Laravel 11.

Finally, we would like to thank the Laravel community for their contributions to this release. We are truly grateful for the time and effort that so many of you have dedicated to making Laravel 11 a reality.

We hope you enjoy the new release and look forward to seeing the amazing applications you build with Laravel 11.0!

Laravel 11 Now Available - The Laravel Blog (2024)

FAQs

What is the difference between Laravel 10 and 11? ›

Laravel 11 continues the improvements made in Laravel 10.x by introducing a streamlined application structure, per-second rate limiting, health routing, graceful encryption key rotation, queue testing improvements, Resend mail transport, Prompt validator integration, new Artisan commands, and more.

Is Laravel still relevant in 2024? ›

In 2024, we expect the use of Laravel for microservices development to continue to grow, as more and more companies recognize the benefits of this approach. Furthermore, Laravel also offers excellent support for the deployment of microservices.

Has Laravel 11 been released? ›

Laravel 11 was released on March 12, 2024.

The framework last had LTS (Long-Term Support) in version 6, but each major version has two years of updates, which should give you enough time to get your codebase in check and upgrade it.

What PHP version is needed for Laravel 11? ›

Laravel now requires PHP 8.2.0 or greater.

What is the most stable Laravel version? ›

The latest stable release of Laravel is version 11. It's been publicly available since March 12, 2024. This version introduced numerous new features and changes. Laravel 11 will be supported until September 3rd, 2025 for bug fixes and until March 12th, 2026 for security fixes.

Is Laravel outdated? ›

Because the world is undergoing rapid change, there is no need for you to concern yourself with any technology that may soon become obsolete. But the good news is that you won't have to worry about soon Laravel disappears. It's going to expand much farther!

Does Laravel have a future? ›

Absolutely! PHP, especially with frameworks like Laravel, continues to be a robust choice for web development in 2024, and there are several reasons why it will likely maintain its relevance: Strong Ecosystem: PHP has a vast and mature ecosystem with a wide range of frameworks, libraries, and tools.

Is React better than Laravel? ›

Laravel and React are two well-liked choices that frequently find themselves in the spotlight. These two effective tools have distinct advantages and are frequently employed for various objectives. Laravel is a strong PHP framework and React is a powerful JavaScript library that is essential to modern web development.

Why not to use Laravel? ›

The Cons of Laravel

Higher Cost: Hiring a Laravel developer can be relatively more expensive due to factors like developer experience, time invested, and engagement models, making it pricier compared to other frameworks.

What is the life cycle of Laravel 11? ›

Support Lifecycle of Laravel 11

Bug fixes will be given for two years after the release date, and security updates will be given for three years after that.

What is the new structure of Laravel 11? ›

The revamped directory structure in Laravel 11

This change simplifies the organization of project files and pares down the boilerplate code included in previous Laravel versions. Removing certain directories, like app/Exceptions and app/Http/Middleware, makes the Laravel 11 structure cleaner than previous versions.

Why is there no kernel PHP in Laravel? ›

Kernel Consol No Longer Available

The dedicated Console Kernel file has been removed in Laravel 11. Instead, developers can define console commands in the routes/console. php file, where they can store all Artisan commands to help ease the management of console commands during development.

Is Laravel 11 faster? ›

Your web application will run smoother with Laravel 11. It has better caching, faster routing, and other tweaks under the hood that make things quicker. Laravel 11 includes the latest security updates to help keep your web application and user data safe from hackers.

Who is the founder of Laravel? ›

Laravel is a free and open-source PHP-based web framework for building high-end web applications. It was created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony.

Where is the kernel PHP in Laravel 11? ›

Laravel 11 does not come with a middleware file and the kernel. php file has been removed altogther.

What's new in Laravel 10? ›

Introduction to Laravel 10

Some new features include better security, performance, and functionality of web applications. Before Laravel 9, each version of Laravel was released every six months. But the makers have decided to release a new version annually after the release of Laravel 9.

Can I upgrade to Laravel 10? ›

First, if you are still running Laravel 8, you must upgrade to Laravel 9. It's theoretically possible to upgrade from 8 to 10, but I wouldn't recommend it. Proceed one version at a time.

What is the difference between Laravel 9 and 10? ›

The biggest distinction between Laravel 9 and Laravel 10 is the minimum PHP version required, with Laravel 10 needing PHP 8.0 or above and various improvements to the framework's default setup and packages.

Is Laravel 9 same as Laravel 8? ›

Laravel 9 continues the improvements made in Laravel 8.

References

Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 5719

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.