Latest in branch 5.0
5.0.22
Released 24 Mar 2015
(11 years ago)
SoftwareLaravel
Version5.0
Status
End of life
Supported
PHP versions
PHP ≥ 5.4.0
Initial release5.0.0
04 Feb 2015
(11 years ago)
Latest release5.0.22
24 Mar 2015
(11 years ago)
End of bug fixes31 Aug 2015
(Ended 10 years ago)
End of security fixes29 Feb 2016
(Ended 10 years ago)
Release noteshttps://github.com/laravel/laravel/releases/tag/v5.0.22
Source codehttps://github.com/laravel/laravel/tree/v5.0.22
Documentationhttps://laravel.com/docs
Downloadhttps://laravel.com/docs/master/installation
Laravel 5.0 ReleasesView full list

What Is New in Laravel 5.0

Laravel 5.0 is a foundational release that introduced a new application structure and a suite of tools designed for modern PHP development.

Category Key Changes
New Features Directory Restructure, Route Caching, Contracts, Form Requests, Commands & Events, Socialite, Scheduler, Dotenv, Filesystem Abstraction
Improvements Method Injection, Blade Improvements, Exception Handling, Configuration Cache, Environment Detection
Deprecated / Removed Removal of Form and HTML helpers, Filters (replaced by Middleware)

How did the application structure change?

The entire directory structure was overhauled to be more intuitive and scalable. The old app/models, app/controllers, and app/database directories were removed.

New default directories were introduced, including app/Http for controllers and middleware, app/Providers for service providers, and database at the project root for migrations and seeds. This new structure better organizes code by its purpose rather than its type.

What are Contracts and why use them?

Contracts are a set of interfaces that define the core services provided by the framework. Examples include Illuminate\Contracts\Mail\Mailer and Illuminate\Contracts\Cache\Repository.

They provide a clear, defined API for framework functionality. In practice, this makes your code more decoupled and testable because you can type-hint these interfaces instead of concrete implementations, allowing for easy mocking and swapping of services.

How do Form Requests simplify validation?

Form Requests are dedicated request classes that handle authorization and validation logic, moving it out of your controllers. You create one using the Artisan command: php artisan make:request MyRequest.

This approach keeps your controllers lean. The validation rules are defined in the rules() method of the Form Request class, and the framework automatically validates the incoming request before it even reaches your controller method.

public function rules()
{
    return [
        'title' => 'required|max:255',
        'body' => 'required',
    ];
}

What new Artisan commands were added?

Laravel 5.0 expanded Artisan's code generation capabilities significantly. New commands were introduced to quickly scaffold common application components.

You could now generate controllers, middleware, form requests, console commands, and event classes directly from the terminal. This standardized development and ensured these classes were created with the proper boilerplate and namespaces from the start.

php artisan make:controller
php artisan make:middleware
php artisan make:request
php artisan make:command
php artisan make:event

How was routing improved?

Route filtering was replaced with HTTP Middleware, a more flexible and powerful mechanism. The new php artisan route:cache command was a game-changer for performance.

This command serializes your route registration, drastically reducing the time it takes to load your application's routes on every request. This matters because it removes a significant overhead, especially for applications with hundreds of routes.

FAQ

Where did the models directory go?
The app/models directory was removed. The new convention is to place Eloquent models directly in the app/ directory, encouraging them to be treated as first-class citizens in your application architecture.

What happened to form and HTML helpers?
They were removed from the core framework. The official guidance was to use HTML and form builders provided by the community, specifically the Laravel Collective package, which maintained these tools.

How do I create a scheduled task?
Laravel 5.0 introduced the built-in Scheduler. You define all your cron jobs in the schedule method of the app/Console/Kernel.php file. You then only need a single cron entry on your server that runs php artisan schedule:run every minute.

What is the .env file for?
Laravel 5.0 adopted the PHP library vlucas/phpdotenv. The .env file is an environment-specific file (not committed to source control) that holds your configuration variables, like database credentials and API keys, keeping them secure and separate from your code.

Is middleware the same as filters?
They serve a similar purpose but middleware is a more standardized and powerful pattern. All filters were converted to middleware, and the new system allows for easier stacking and handling of HTTP requests both before and after they are processed by your application.

Releases In Branch 5.0

VersionRelease date
5.0.2224 Mar 2015
(11 years ago)
5.0.1613 Mar 2015
(11 years ago)
5.0.106 Feb 2015
(11 years ago)
5.0.004 Feb 2015
(11 years ago)