Laravel is most preferred PHP framework by web artisans, and its journey from humble beginnings to advanced framework is truly inspiring. Looking back, it’s fascinating to trace the evolution of Laravel versions and witness the incredible progress it has made.
Laravel 1.0
Release in June 2011
- MVC Architecture: Laravel 1 introduced a robust Model-View-Controller (MVC) architecture, promoting separation of concerns and making applications more maintainable.
- Eloquent ORM: Laravel’s ORM, Eloquent, provided a fluent interface for interacting with databases, making database management more intuitive and efficient.
- Blade Templating Engine: Blade, Laravel’s templating engine, allowed for efficient and readable syntax when working with frontend templates, enhancing developer productivity.
- RESTful Routing: Laravel pioneered the use of RESTful routing in PHP frameworks, making it easier to define application routes that corresponded to CRUD (Create, Read, Update, Delete) operations.
- Authentication and Authorization: Built-in support for user authentication and authorization simplified the implementation of secure user access controls.
Minimum PHP Compatibility
- PHP Version: Laravel 1 was compatible with PHP 5.3.7 or later versions. This ensured compatibility with the latest PHP features and improvements available at that time.
Laravel 2.0
- Improved Routing System: Laravel 2 introduced significant improvements to its routing system, making it more flexible and powerful. Developers could now define routes more intuitively and manage complex routing scenarios with ease.
- Enhanced Composer Support: This version enhanced its support for Composer, the dependency manager for PHP, which allowed developers to easily manage third-party libraries and packages within their Laravel applications.
- Database Schema Builder: Laravel 2 improved upon its database capabilities with a schema builder, providing a fluent interface for defining and modifying database tables and indexes directly within PHP code.
- Sub-Domain Handling: It introduced better support for handling sub-domains within applications, enabling developers to create multi-tenant or segmented applications more effectively.
Minimum PHP Compatibility
- PHP Version: Laravel 2 required PHP 5.3.7 or later versions. This ensured compatibility with the latest PHP features available at that time and laid the groundwork for leveraging newer PHP functionalities in Laravel applications.
Laravel 3.0
- Introduction of Bundles: Laravel 3 introduced the concept of Bundles, which were like packages or modules that encapsulated reusable code and functionality. Bundles allowed developers to easily extend Laravel’s capabilities and share components across projects.
- Improved IoC Container: The Inversion of Control (IoC) container in Laravel 3 was enhanced, offering better dependency injection capabilities. This made it easier to manage class dependencies and improve the overall testability and flexibility of Laravel applications.
- Fluent Query Builder: Building on its database capabilities, Laravel 3 introduced the Fluent Query Builder. This feature provided a fluent interface for constructing SQL queries programmatically, offering developers a more intuitive and expressive way to interact with databases.
- Database Seeding and Migration: Laravel 3 introduced database seeding and migration tools. Database seeding allowed developers to populate their databases with test data, while migration tools facilitated version control and management of database schema changes over time.
Minimum PHP Compatibility
- PHP Version: Laravel 3 required PHP 5.3.0 or later versions. This version requirement ensured compatibility with PHP’s object-oriented features and improvements, supporting the adoption of modern PHP development practices.
Laravel 4.0
- Composer-Based Application Structure: Laravel 4 adopted a Composer-based application structure, leveraging Composer for dependency management. This allowed developers to easily manage and integrate third-party libraries and packages into their Laravel projects.
- Eloquent ORM Enhancements: Building on its ORM capabilities, Laravel 4 introduced significant enhancements to Eloquent, making it more powerful and flexible for database interaction. Features like relationships, eager loading, and query scopes were improved, providing developers with more control and efficiency when working with databases.
- Artisan Console Enhancements: The Artisan command-line interface in Laravel 4 received enhancements, offering a wide range of commands to automate tasks such as database migrations, seeding, and generating boilerplate code for controllers, models, and more.
- Queue Management with Redis: Laravel 4 introduced robust queue management capabilities using Redis as the default queue driver. This feature enabled developers to offload time-consuming tasks to background queues for improved application responsiveness and performance.
- Built-in Authentication Support: Laravel 4 included built-in support for authentication, making it easier to implement user authentication and authorization features within applications. It provided pre-built components and methods to handle user registration, login, password reset, and more.
Minimum PHP Compatibility
- PHP Version: Laravel 4 required PHP 5.3.7 or later versions. This version requirement ensured compatibility with PHP’s object-oriented features and improvements, supporting modern PHP development practices and security updates.
Laravel 5.0
- Release Date: February 2015
- Key Features:
- Laravel Elixir: A fluent API for defining Gulp tasks, providing a streamlined approach to asset compilation and management.
- Middleware: Enhanced middleware support, allowing developers to filter HTTP requests entering the application.
- Form Requests: Introduced form request validation, simplifying the process of validating incoming HTTP request data.
- Minimum PHP Compatibility: PHP 5.5.9 or higher.
Laravel 5.1
- Release Date: June 2015
- Key Features:
- Laravel Homestead: A pre-packaged Vagrant box providing a development environment without requiring additional configuration.
- Laravel Forge: A server provisioning and management service, offering streamlined deployment and server management for Laravel applications.
- Model Factories: Introduced model factories for easily generating test data.
- Minimum PHP Compatibility: PHP 5.5.9 or higher.
Laravel 5.2
- Release Date: December 2015
- Key Features:
- Laravel Broadcasting: Real-time event broadcasting and integration with websockets using technologies like Pusher.
- Middleware Groups: Ability to group multiple middleware under a single key for easier application.
- Minimum PHP Compatibility: PHP 5.5.9 or higher.
Laravel 5.3
- Release Date: August 2016
- Key Features:
- Laravel Passport: Full OAuth2 server implementation for API authentication.
- Mailables: Simplified email sending with Mailable classes and a new email API.
- Laravel Scout: Full-text search with Algolia integration.
- Minimum PHP Compatibility: PHP 5.6.4 or higher.
Laravel 5.4
- Release Date: January 2017
- Key Features:
- Laravel Dusk: Browser automation and testing API, allowing automated tests for JavaScript-heavy applications.
- Laravel Mix: A simplified API for compiling assets with Webpack.
- Blade Components and Slots: Introduces reusable Blade components and slots for better code organization.
- Minimum PHP Compatibility: PHP 5.6.4 or higher.
Laravel 5.5
- Release Date: August 2017
- Key Features:
- Laravel Package Auto-Discovery: Automatic service provider and facade discovery for Composer-installed packages.
- Laravel Mix: Continued improvements in asset compilation and versioning.
- Laravel Blade Directives: Additional Blade directives for common tasks like authentication checks and conditional rendering.
- Minimum PHP Compatibility: PHP 7.0.0 or higher.
Laravel 6.0
Laravel 6.x was released in September 2019 and is built on top of PHP 7.2.5 or higher. Some of the new features introduced in Laravel 6.x include:
- Lazy Collections: Laravel 6.x introduces a new
LazyCollection
class that allows you to work with large, lazy collections of data. This can help reduce memory usage when working with large datasets. - Job Middleware: Laravel 6.x introduces job middleware, which allows you to add middleware to your job classes. This can be useful for logging, rate limiting, or other tasks that need to be performed before or after a job is executed.
- Eloquent Subquery Improvements: Laravel 6.x includes several improvements to Eloquent’s subquery handling, making it easier to build complex queries with subqueries.
- Custom Eloquent Casts: Laravel 6.x allows you to define your own custom casts for Eloquent models, making it easier to work with complex data types.
- Ignition: Laravel 6.x includes a new error page and debugger called Ignition, which provides a more user-friendly error page and better stack traces.
- Semantic Versioning: Laravel 6.x moves to semantic versioning, which means that minor version updates will not include breaking changes.
These are just a few of the new features introduced in Laravel 6.x. There are many other improvements and bug fixes included in this release as well.
Laravel 7.0
Laravel 7.x was released in March 2020 and requires PHP 7.3 or higher. Some of the new features introduced in Laravel 7.x include:
- PHP 7.4 Support: Laravel 7.x adds support for PHP 7.4, which includes several performance improvements and new language features.
- Improved Authorization: Laravel 7.x includes several improvements to the authorization system, including the ability to define custom policies for middleware and the ability to use middleware directly in routes.
- Routes Ignition: Laravel 7.x includes the Ignition error page and debugger for routes, making it easier to debug route-related issues.
- Blade Component Tags: Laravel 7.x introduces Blade component tags, which make it easier to work with Blade components.
- Job Batching: Laravel 7.x introduces job batching, which allows you to execute multiple jobs at once.
- Rate Limiting Improvements: Laravel 7.x includes several improvements to the rate limiting system, including the ability to define custom rate limiters and the ability to use middleware to apply rate limits.
- Mailables: Laravel 7.x introduces a new
Mailables
directory, which makes it easier to organize your email templates. - Error Pages Improvements: Laravel 7.x includes several improvements to error pages, including the ability to customize the error page layout and the ability to define custom error pages for different HTTP status codes.
Laravel 8.0
Laravel version 8.0 was released on September 8, 2020, and introduces several new features and improvements. Here are some of the highlights:
Event Listener Improvements:
- Laravel 8.x makes it easier to register closure-based event listeners by simply passing the closure to the
Event::listen
method. - Queued closure-based event listeners can be customized using the
Illuminate\Events\queueable
function, and can be customized further using theonConnection
,onQueue
, anddelay
methods. - Queued listener failures can be handled using the
catch
method.
Time Testing Helpers:
- Laravel 8.x introduces new time testing helpers that allow you to modify the time returned by functions such as
now
orIlluminate\Support\Carbon::now
. - You can travel into the future using methods like
travel()->seconds()
,travel()->days()
, etc., and travel into the past using negative values liketravel(-5)->hours()
. - You can travel to an explicit time using the
travelTo()
function and return back to the present time with thetravelBack()
function.
Artisan Serve Improvements:
- The
artisan serve
command now has automatic reloading when environment variable changes are detected in the.env
file.
Laravel Paginator Update:
- Laravel 8.x updates the paginator to use the Tailwind CSS framework by default, while still keeping the Bootstrap 3 and 4 views available.
RouteServiceProvider Changes:
- In Laravel 8.x, the
$namespace
property is null by default, meaning no automatic namespace prefixing. - Controller route definitions should now use standard PHP callable syntax.
- Calls to action-related methods should use the same callable syntax.
- To use Laravel 7.x style controller route prefixing, add the
$namespace
property back into yourRouteServiceProvider
.
Laravel 9.0
Laravel version 9.0 was released on February 15, 2022, and includes several new features and improvements. Here are some of the highlights:
Improved Validation of Nested Array Inputs:
- Laravel 9.x introduces improvements to the validation of nested array inputs, including the ability to access the value for a given nested array element when assigning validation rules.
- The
Rule::forEach
method can be used to assign validation to array elements.
Laravel Breeze API Scaffolding and Next.js Starter Kit:
- Laravel Breeze includes a new “API” scaffolding mode that can be used to start Laravel applications serving as a backend API for a JS frontend.
- A complimentary Next.js frontend implementation is included.
Ignition Redesign:
- The open-source exception debug page in Ignition has been redesigned to include light/dark themes and customizable “open in editor” functionality.
Improved Route:list CLI Output:
- The output for
route:list
has been significantly improved in Laravel 9.x, providing a better experience when exploring route definitions.
Test Coverage Using Artisan Test Command:
- The
Artisan test
command now includes a new--coverage
option to explore test coverage. - Test coverage can be displayed directly in the CLI output.
- A new
--min
option can be used to specify a minimum test coverage percentage.
Soketi Echo Server:
- Laravel Echo now includes a compatible Web Socket server for Node.js called Soketi.
- Soketi is an open-source alternative to Pusher and Ably.
- Consult the broadcasting documentation and Soketi documentation for more information.
Improved Collections IDE Support:
- Laravel 9.x includes improved collections IDE support, including “generic” style type definitions for better IDE and static analysis support.
New Helper Functions:
- The
str
function returns a newStringable
instance or theStr
instance. - The
to_route
function generates a redirect HTTP response for a named route.
Laravel 10.0
Laravel 10.0, released on Valentine’s Day 2023, brings a bouquet of new features designed to make your development experience smoother and more efficient. Let’s dive into the highlights:
Type-Safe Development:
Laravel 10 embraces type hinting, making your code more robust and easier to understand. This means:
- Clearer Code: All core framework methods now have clearly defined argument and return types.
- Consistent Structure: New classes generated using Laravel’s scaffolding tools are type-aware, ensuring consistency.
- Backwards Compatibility: Don’t worry about breaking changes – your existing projects will work seamlessly.
Commanding Control Over External Processes:
The new Process
facade gives you a powerful way to interact with external processes directly within your Laravel applications.
- Start & Manage: Launch processes, manage them in pools for concurrency, and even simulate processes for testing.
- Assertions for Testing: Easily test interactions with external processes using assertions like
Process::assertRan('ls -la')
.
Feature Flags Made Easy with Laravel Pennant:
Introducing Laravel Pennant, a first-party package that simplifies managing feature flags:
- Flexible Options: Choose between in-memory storage for quick testing or persistent database storage for real-world scenarios.
- Effortless Definition: Define your features using the
Feature::define
method. - Blade Directives: Check if a feature is active directly in your Blade templates with convenient directives.
Test Performance at Your Fingertips:
Identify performance bottlenecks in your tests with the new --profile
option for the Artisan test command. The slowest tests are displayed directly in the CLI output, allowing you to optimize your test suite.
Pest Test Scaffolding:
If you’re a fan of the Pest testing framework, you can now opt-in to Pest scaffolding when creating new Laravel projects using the --pest
flag.
Streamlined Generator Experience:
Laravel’s built-in make
commands have been streamlined, eliminating the need for manual input. If you forget to provide arguments, you’ll be prompted for them, making the process more intuitive.
Horizon & Telescope: A Fresh Look:
The user interfaces of Horizon (queue monitoring) and Telescope (debugging tool) have received a fresh, modern makeover with improved typography, spacing, and design.
Laravel 10.0 is a testament to the framework’s ongoing commitment to developer experience and performance. These new features offer a powerful toolkit for building robust, efficient, and maintainable web applications.
Laravel 11.0
Laravel 11.0, released on March 14, 2024, takes the framework to new heights with a focus on streamlining, real-time capabilities, and performance enhancements. Let’s explore the key features:
A Slimmer, More Focused Core:
Laravel 11.0 introduces a streamlined application structure, making your codebase cleaner and more efficient:
- Code-First Configuration: The
bootstrap/app.php
file is revitalized for a more code-centric approach to configuration. - Consolidated Service Providers: The default service providers are consolidated into a single
AppServiceProvider
, reducing clutter. - Opt-in API & Broadcast Routing: API and broadcast routing are now opt-in features, allowing you to tailor your application structure more precisely.
- Framework-Level Middleware: Middleware is now integrated into the framework itself, resulting in a leaner application structure.
Real-Time Power with Laravel Reverb:
Laravel 11.0 introduces Laravel Reverb, a powerful and scalable WebSocket server:
- Real-Time Communication: Build real-time features like chat applications, live dashboards, and collaborative tools.
- Horizontal Scaling: Leverage Redis’s publish/subscribe capabilities to easily scale your WebSocket server horizontally.
Rate Limiting: Per-Second Precision:
Laravel 11.0 introduces per-second rate limiting, providing granular control over requests and queued jobs:
- Fine-Grained Control: Limit requests and jobs on a per-second basis, ensuring a smoother user experience and preventing abuse.
Health Checks & Encryption Key Rotation:
- Health Routing: A simple
/up
endpoint makes it easy to monitor the health of your services. - Graceful Encryption Key Rotation: Define and use previous encryption keys for decryption, allowing for seamless key rotation.
Prompt Validation & Queue Testing:
- Prompt Validator Integration: Leverage Laravel’s validator for validating prompt inputs, ensuring data integrity.
- Simplified Queue Testing: Easily test the release, deletion, and manual failure of queued jobs, making your testing process more efficient.
Enhanced Productivity & Performance:
- New Artisan Commands: Quickly create classes, enums, interfaces, and traits with dedicated Artisan commands.
- Model Casts Improvements: Define model casts using a method, simplifying your code and improving readability.
- The
once
Function: Cache the result of a callback in memory for the duration of the request, boosting performance. - Improved In-Memory Database Performance: PHP’s PDO object is reused across connections, resulting in faster testing.
- MariaDB Support: A dedicated MariaDB driver with improved defaults optimizes performance for MariaDB users.