DEV Community

Cover image for Explore the latest Laravel updates and what’s next 👀
Proxify for Developers
Proxify for Developers

Posted on

Explore the latest Laravel updates and what’s next 👀

Can the latest Laravel updates enhance your coding flow?

The latest release, Laravel 10.25, rolls out considerable enhancements and features for the popular PHP web application framework. With the anticipation of Laravel 11's launch in Q1 of 2024, it promises to bring substantial improvements and new features to the Laravel ecosystem.

Let's uncover the fresh offerings of Laravel 10.25 and get a sneak peek into the future improvements of Laravel 11, all tailored to fine-tune your development journey.

What's new in Laravel 10.25

The recent release of Laravel 10.25 brings many new features and improvements to the popular PHP web application framework. The update includes significant additions such as exception throttling, a new String take() method, and an increase in bcrypt rounds, enhancing both the functionality and security of Laravel applications.

Throttle exceptions

One of the notable features of this release is the ability to throttle exceptions by sampling or rate-limiting exception reporting. Contributed by Tim MacDonald, this feature allows your exception Handler class to define a throttle() method, giving you the flexibility to rate limit based on an exception type. This update can be particularly useful for limiting the amount of logs logged per minute or opting out for a given exception type.

String take() method

Another significant addition is the take() method to Str and Stringable, contributed by Moshe Brodsky. This method acts as syntactic sugar for substr(), allowing you to easily take characters from the beginning or end of a string. This enhancement simplifies string manipulation, making your code cleaner and more readable.

Increase bcrypt rounds to 12

To keep up with increases in computing, Stephen Rees-Carter contributed to increasing bcrypt rounds from 10 to 12. This change aligns with PHP's move to increase the default bcrypt cost to either 11 or 12, ensuring a balance between performance and security within Laravel. Symfony uses a cost of 13, but 12 is considered to be the sweet spot for most servers.

Other updates and fixes

Laravel 10.25 also includes other updates and fixes, enhancing the overall stability and reliability of the framework. Some of these include:

  • Fixing key type in @return tag of EnumeratesValues::ensure() docblock.

  • Creating a fluent method convertCase.

  • Disabling autoincrement for unsupported column type.

  • Ensuring array driver expires values at the expiry time.

  • Handling custom extensions when caching views.

To learn more, see the complete list of new features and updates in the release notes and the difference between 10.24.0 and 10.25.0 on GitHub.

What's coming in Laravel 11:

Streamlined directory structure

In the upcoming Laravel 11, the directory structure will be more organized and efficient. Controllers will not automatically inherit properties and methods, offering developers more flexibility. The middleware directory, used for filtering HTTP requests, will be removed to simplify the framework's structure. Tasks previously handled by the Kernel will now shift to the Bootstrap/App, centralizing the initial setup and configuration of the application and enhancing the development process.

Model casts changes

Model casts will now be defined as a method instead of a property, allowing for more flexibility and functionality, such as calling other methods directly from the casts. This change allows for more dynamic and flexible model casting, enhancing the overall development experience.

Config changes

Laravel 11 aims to simplify configuration by removing multiple config files and expanding the .env file to include all options you'd want to set. A new config:publish command will be introduced to bring back any config you might want, streamlining the configuration process and making it more intuitive.

Slimmed default migrations and routes changes

Default migrations will be slimmed down, with dates removed and moved into just two files. By default, there will be only two route files, console.php and web.php. API routes and websocket broadcasting will become opt-in, streamlining the routing structure and making it more manageable.

Console Kernel removed

The Console Kernel will be removed, allowing you to define your console commands right in routes/console.php. This change simplifies the console command definition and makes the process more straightforward.

Named arguments and PHP 8.2 support

Laravel 11 will support named arguments and require a minimum of PHP 8.2, ensuring that the framework stays up-to-date with the latest PHP advancements. This update guarantees that Laravel continues to provide robust support for the latest PHP features, enhancing compatibility and performance.

Support policy

Laravel 11 will continue the tradition of providing bug fixes, ensuring long-term support and stability for all Laravel projects.

Conclusion

Both Laravel 10.25 and the upcoming Laravel 11 continue to make Laravel a compelling choice for web application development, bringing new features and improvements that will undoubtedly benefit the Laravel community. The ongoing enhancements and the commitment to keeping the framework up-to-date with the latest technology trends ensure that Laravel remains a leading choice for developers worldwide.


Which feature do you believe will have the most significant impact on your workflow?

Share your thoughts in the comments section below.


Find the best Laravel remote jobs, without the hassle. Click here to apply

Top comments (0)