Last Updated: February 24th, 2024Categories: Technology7.5 min read

Laravel 11: New Features and Updates

LARAVEL 11 NEW FEATURES AND UPDATES

Table Of Content

Laravel, the ever-evolving PHP framework, has been synonymous with web development excellence for years. Its modular structure, MVC architecture, and extensive documentation have made it a developer darling.

The upcoming release of Laravel 11 has sent ripples of excitement through the development scene.

From streamlined development experiences to enhanced performance optimizations, Laravel 11 promises to push the boundaries of web development and unlock a whole new era of possibilities.

In what follows, we’ll explore the exciting new features and updates that await you in this revolutionary framework.

When Will Laravel 11 Be Released?

Laravel follows a predictable release schedule. Major versions with potential breaking changes come out yearly (around Q1), while minor and patch updates arrive weekly and never break compatibility.

Based on this pattern, Laravel 11 is expected to be released in February 2024, during the first quarter.

How to Install Laravel 11?

While Laravel 11 isn’t officially out yet, you can still explore its cutting-edge features by installing the development version. Here’s how:

1. Using the Laravel Installer

Open your terminal and run this command:

laravel new projectname --dev

This command fetches the latest code from the master branch of the Laravel repository, giving you a taste of what’s to come in Laravel 11.

2. Using Composer Directly

If you prefer Composer, use this command instead:

composer create-project --prefer-dist laravel/laravel projectname dev-master

This approach also sets you up with the development version of Laravel 11.

Laravel Development at Its Best

Make the most of Laravel’s features with Bsuperior LTD. Get your scalable and secure Laravel projects delivered on time.

Laravel 11: Latest Features and Updates

Laravel 11 is still under development, but there are some exciting features and updates we can expect based on early access and merged pull requests. Here’s a glimpse of what’s coming to Laravel 11:

Slim Skeleton

By Taylor Otwell on laravel/framework#47309 and laravel/laravel#6188

Laravel 11 unveils a slimmer and sleeker application Skeleton that prioritizes efficiency and code minimalism. This minimalistic skeleton enables developers to start building faster and with less clutter. Key changes include:

  • Drastically reduced service providers, middleware, and configuration files, with customization now primarily handled within the new bootstrap/app.php file.
  • Automatic discovery of policies and events, eliminating manual registration.
  • User model updates and removal of “Sanctum” by default, offering a cleaner starting point.
  • Environment variables expanded and renamed for clarity, and default queue connection set to database.
  • Migrations consolidated and re-dated for evergreen setups.

Dropped Support for PHP 8.1

By Dries Vints on laravel/framework#45526 

Laravel 11 is making waves in the web development world with its bold decision to leapfrog over PHP 8.1 and directly support the upcoming versions, 8.2 and 8.3.

This forward-thinking move signals Laravel’s commitment to staying at the forefront of PHP technology, leaving behind past iterations for the exciting possibilities of the future.

Instead of getting bogged down with compatibility concerns for an already established PHP version, Laravel 11 sets its sights on the horizon by embracing the new features and performance enhancements that 8.2 and 8.3 have to offer.

This allows developers to use the latest advancements in PHP right from the get-go, and build cleaner, faster, and more efficient web applications.

Read more: Is Laravel good for Startup? Why it is the Best PHP Framework for Startups?

Doctrine DBAL Removal

By Hafez Divandari  on laravel/framework#48864

Laravel 11 is dropping Doctrine DBAL and moving to native database schema methods. This brings several improvements, including:

  • Simplified Codebase: Removing Doctrine DBAL reduces complexity and makes the framework easier to maintain.
  • Native Column Modification: Laravel now supports native column modification, renaming, and dropping on all database drivers including SQLite and legacy MySQL versions.
  • Improved Artisan Commands: db:show, db:table, and model:show commands are rewritten for better performance and readability.
  • Additional Features: User-defined types (PostgreSQL) and schema information (PostgreSQL, SQL Server) are accessible through artisan commands. Also, SQLite now supports collation for columns.

Read more: Which Front-end Framework is Best for Laravel?

Added Support for Eager Loading with Limit

By Jonas Staudenmeir on laravel/framework#49695

It wasn’t possible to use the `limit` and `take` query builder methods when constraining eager loads. It’s now fixed on Laravel 11:

User::with(['posts' => function ($query) {
    $query->latest()->limit(10);
}])->get();

Database Floating-Types Refactored

By Hafez Divandari on laravel/framework#48861 

Laravel 11 is streamlining floating-point column types across databases and removing unsigned options for consistency and compatibility.

Key Reasons For These Changes:

  • Aligning with Database Standards: Most databases allow passing precision to float type to choose between standard 4-byte and 8-byte storage, respectively. Laravel is adjusting its syntax to match.
  • Addressing MySQL Deprecations: MySQL 8.0.17 deprecated certain syntax and unsigned attributes for floating-point types, motivating Laravel to adapt.

Specific Changes Being Made:

  1. Consistent Float and Double Definitions:
  • Blueprint’s float method now accepts $precision argument instead of $total and $scale.
  • Blueprint’s double method doesn’t accept $total and $scale arguments anymore.
  1. Removal of Unsigned Options:
  • $blueprint->unsignedFloat(), $blueprint->unsignedDouble(), and $blueprint->unsignedDecimal() are being removed.

Database Spatial Types Refactored

By Hafez Divandari on laravel/framework#49634 

Laravel 11 is revamping its handling of spatial data types across MySQL, PostgreSQL (with PostGIS), SQL Server, and SQLite (with SpatiaLite) to ensure consistent behavior and wider compatibility. This also addresses some existing inconsistencies and limitations.

Why the Change?

  • Previous Inconsistencies: Spatial data usage and results vary across databases, making it hard to predict.
  • Confusing Defaults: The default geometry type automatically maps to geography, and causes confusion.
  • PostgreSQL Conflicts: Native PostgreSQL types clash with implemented PostGIS types, especially for points and polygons.
  • Limited PostGIS Support: Laravel couldn’t use the full range of PostGIS subtypes for geometry and geography.

What’s New?

  • Unified geometry and geography Types: Both accept optional subtype and SRID (Spatial Reference System Identifier) parameters.
  • Subtype Support: Laravel now recognizes specific subtypes for MySQLand PostGIS.
  • Full PostGIS Subtype Access: Laravel can now utilize all PostGIS geometry and geography subtypes.
  • SQL Server geometry Recognition: Spatial types are correctly mapped to their respective database types.

Secure Randomness in Array Helpers

By Stephen Rees-Carter on laravel/framework#49642 

Laravel 11 takes a bold step towards bolstering randomness security within its core array helpers.

  • Enhancing Randomness Security: Arr::random() and Arr::shuffle(), along with their Collection counterparts, are being upgraded to use secure randomness functions.
  • Addressing Previous Vulnerabilities: Str::password()‘s insecure shuffle has been fixed.
  • Considering a Standalone Random Class: The potential of incorporating a dedicated Random class into Laravel’s core is being explored.
  • Removing Seed Functionality: The $seed parameter for shuffle() has been removed to promote explicit and consistent randomness implementation within the code.

Dedicated Database Configs for MariaDB

By Julius Kiekbusch on laravel/framework#48455 

Laravel 11 is enhancing its compatibility with MariaDB by introducing dedicated configuration options and adopting recommended collations.

Key Changes:

  1. Separate Configuration: MariaDB now has its own configuration section, distinct from MySQL, for tailored settings.
  2. Collation Updates:
  • Default collation for MySQL is now utf8mb4_0900_ai_ci.
  • Default collation for MariaDB is now utf8mb4_uca1400_ai_ci.
  1. Testing: MariaDB configuration is being tested specifically against MariaDB databases to ensure consistency.

Per-Second Rate Limiting

By Tim MacDonald on laravel/framework#48498 

Laravel 11 is expanding its rate-limiting capabilities by natively supporting per-second limits.

  • Direct Per-Second Control: Developers can now define rate limits based on seconds using Limit::perSecond().
  • Flexible Configuration: Per-second limits can be combined with existing per-minute limits for granular control.
  • Enhanced Protection: Mitigates request bursts and smooths out traffic patterns for improved performance and security.

Why Should Businesses Upgrade to Laravel 11?

Upgrading to Laravel 11 offers significant benefits for businesses, from enhanced performance and security to improved developer experience and access to new features.

While every project has unique considerations, the overall advantages of Laravel 11 make it a compelling choice for businesses looking to modernize and future-proof their web applications.

Read more: Laravel vs. CodeIgniter: Which One is Better?

Below you can find 5 reasons why businesses should consider upgrading to Laravel 11:

  • Faster: Laravel 11 boasts performance improvements under the hood, including optimized database queries, better caching mechanisms, and improved routing.
    This can translate to faster loading times and a smoother user experience for your customers.
  • More Secure: Laravel 11 introduces several security enhancements, including upgraded randomness functions and increased bcrypt rounds to 12.
    Additionally, the framework prioritizes secure dependencies and deprecates outdated methods, reducing the attack surface for potential threats.
  • Smoother Development: Laravel 11 focuses on making developer life easier with improved documentation, error handling, and debugging tools. This can lead to faster development times and reduced frustration for your team.
  • More Readable Code: The framework continues its commitment to clean and concise syntax, making code easier to understand and maintain in the long run.
  • Improved Database Support: Laravel 11 introduces a dedicated configuration for MariaDB and adopts recommended collations for both MySQL and MariaDB.

Final Words

Laravel 11 marks a bold leap forward, not just in its features but in its philosophy. It embraces the latest technologies, prioritizes developer experience, and lays the groundwork for even greater innovation in the years to come.

From streamlined development with the slim Skeleton to future-proofed support for PHP 8.2 and 8.3, Laravel 11 is an invitation to build faster, cleaner, and more secure applications.

Laravel 11 isn’t just an upgrade, it’s an investment in your future. Embrace the revolution, and build the next generation of web applications with Laravel.

Share Now

About the Author: Aso Biri

Aso Biri is a staff writer for BSuperior, where he primarily focuses on writing tech-related blog posts. He has a passion for technology and loves to stay up-to-date on the latest trends. When he's not writing, he enjoys watching football and playing video games.
Contact Us

Contact us today at –– and speak with our specialist.