Stable Release in branch 4.1
4.1.27
Released 15 Apr 2014
(12 years ago)
SoftwareLaravel
Version4.1
Status
End of life
Supported
PHP versions
PHP ≥ 5.3.0
Initial release4.1.0
11 Dec 2013
(12 years ago)
Latest release4.1.27
15 Apr 2014
(12 years ago)
End of bug fixes30 Jun 2014
(Ended 12 years ago)
End of security fixes31 Dec 2014
(Ended 11 years ago)
Release noteshttps://github.com/laravel/laravel/releases/tag/v4.1.27
Source codehttps://github.com/laravel/laravel/tree/v4.1.27
Documentationhttps://laravel.com/docs
Downloadhttps://laravel.com/docs/master/installation
Laravel 4.1 ReleasesView full list

What Is New in Laravel 4.1

Laravel 4.1 introduces a host of new features, improvements, and changes that streamline development and enhance the framework's capabilities. The key updates are summarized in the table below.

Category Key Changes
New Features SSH Task Commands, Database Improvements (Read/Write Connections, PostgreSQL Fixes), Improved Testing (TestCase, Mail Pretending), New Artisan Command
Improvements Routing Performance, Session Driver Changes, Encryption Without Mcrypt, Pagination Customization
Changes & Deprecations PHP 5.4+ Requirement, Form Method Spoofing, Authentication Model Changes, Encryption Key Size

How did database handling get better?

Database operations received significant upgrades for flexibility and reliability. You can now explicitly define read and write connections in your database configuration, which is perfect for directing queries to different database servers.

For PostgreSQL users, the framework fixed an issue where column values were incorrectly returned as strings instead of integers. This resolves a major pain point for data type consistency in applications using PostgreSQL.

What new tools were added for automation?

Laravel 4.1 introduced SSH task commands, a powerful feature for automating remote server operations. You can define tasks that run sequences of commands on remote servers directly from your Laravel application.

This is a game-changer for deployment scripts and common server maintenance tasks. You configure these tasks in a new remote.php config file and run them using the new php artisan remote command.

How was testing improved?

Testing mail operations became much simpler. The Mail::pretend() method was replaced with Mail::shouldReceive('send')->andReturn(false) for a more intuitive and powerful mocking approach within your tests.

The base TestCase now includes be() and actingAs() helper methods. These make it incredibly easy to authenticate a user during integration testing, streamlining the process of testing authenticated routes and actions.

What are the important breaking changes?

The framework now requires PHP 5.4 or greater, dropping support for older PHP versions to utilize newer language features. The encryption system was also overhauled; it no longer requires the Mcrypt extension and now mandates a 32-character key for stronger security.

Form method spoofing now uses a hidden _method field instead of relying on HTTP headers, making it more compatible with various server configurations. The Auth::attempt() method now expects an array of credentials as its first argument, changing from the previous method signature.

FAQ

How do I define read/write database connections?
In your config/database.php file, add 'read' and 'write' keys to a database connection array. Each key should contain an array of connection details, allowing you to specify separate hosts for read and write operations.

My old encryption keys are 16 characters, what should I do?
You must generate a new 32-character key. Run php artisan key:generate to have Laravel create one for you, then update your app/config/app.php file with the new key.

Why was the Mcrypt requirement removed?
The framework moved to an encryption implementation based on OpenSSL and the openssl_encrypt function. This provides better maintainability and removes a dependency on a specific PHP extension that was less commonly used.

How do I mock mail sending in tests now?
Instead of using Mail::pretend(), you should now use Mockery to set expectations. For example: Mail::shouldReceive('send')->andReturn(false); within your test method.

What happened to the `Auth::attempt` method parameters?
The method signature changed. It now accepts an array of credentials as the first argument and a boolean for "remember me" as the second. Update your calls from Auth::attempt($email, $password, $remember) to Auth::attempt(['email' => $email, 'password' => $password], $remember).

Releases In Branch 4.1

VersionRelease date
4.1.2715 Apr 2014
(12 years ago)
4.1.1818 Jan 2014
(12 years ago)
4.1.011 Dec 2013
(12 years ago)