- Released in August 2017, this version introduced improved package discovery, allowing developers to register service providers automatically. It also included enhancements to the command-line interface and several new features for API development.
Author: saqibkhan
-
Laravel 5.5 (2017)
-
Laravel Ecosystem Growth
As Laravel evolved, its ecosystem expanded significantly. Notable tools and packages emerged, including:
- Laravel Mix: Introduced for asset compilation, simplifying the process of managing CSS and JavaScript.
- Laravel Socialite: For handling OAuth authentication with social media platforms.
- Laravel Cashier: To manage subscription billing with Stripe.
-
Laravel 10 (2023)
- Released in February 2023, Laravel 10 focused on enhancing developer experience with features like improved job handling and new query builder macros.
-
Laravel 9 (2022)
- This version introduced features like Laravel Sanctum for API authentication, an improved query builder, and PHP 8 support, along with many other performance and usability enhancements.
-
Laravel 8 (2020)
- Released in September 2020, it brought Laravel Jetstream for application scaffolding, model factories, and enhanced job handling.
-
Laravel 7 (2020)
- Launched in March 2020, it included features like model factories, custom URL generation for routes, and improvements to the Blade component system.
-
Laravel 6 (2019)
- Released in September 2019, Laravel 6 introduced semantic versioning and brought features like job middleware, lazy collections, and improvements to the authorization system.
-
Laravel 5.2 to 5.8 (2016-2019)
- These incremental updates introduced various improvements, such as:
- Laravel Passport for API authentication.
- Job batching and improved queue management.
- Enhanced Blade templating and form validation features.
- These incremental updates introduced various improvements, such as:
-
Cookie
Cookies play an important role while dealing a user’s session on a web application. In this chapter, you will learn about working with cookies in Laravel based web applications.
Creating a Cookie
Cookie can be created by global cookie helper of Laravel. It is an instance of Symfony\Component\HttpFoundation\Cookie. The cookie can be attached to the response using the withCookie() method. Create a response instance of Illuminate\Http\Response class to call the withCookie() method. Cookie generated by the Laravel are encrypted and signed and it can’t be modified or read by the client.
Here is a sample code with explanation.
//Create a response instance $response = new Illuminate\Http\Response('Hello World'); //Call the withCookie() method with the response method $response->withCookie(cookie('name', 'value', $minutes)); //return the response return $response;Cookie() method will take 3 arguments. First argument is the name of the cookie, second argument is the value of the cookie and the third argument is the duration of the cookie after which the cookie will get deleted automatically.
Cookie can be set forever by using the forever method as shown in the below code.
$response->withCookie(cookie()->forever('name', 'value'));Retrieving a Cookie
Once we set the cookie, we can retrieve the cookie by cookie() method. This cookie() method will take only one argument which will be the name of the cookie. The cookie method can be called by using the instance of Illuminate\Http\Request.
Here is a sample code.
//’name’ is the name of the cookie to retrieve the value of $value = $request->cookie('name');Example
Observe the following example to understand more about Cookies −
Step 1 − Execute the below command to create a controller in which we will manipulate the cookie.
php artisan make:controller CookieController --plainStep 2 − After successful execution, you will receive the following output −

Step 3 − Copy the following code in
app/Http/Controllers/CookieController.php file.
app/Http/Controllers/CookieController.php
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; use App\Http\Requests; use App\Http\Controllers\Controller; class CookieController extends Controller { public function setCookie(Request $request) {
} public function getCookie(Request $request) {$minutes = 1; $response = new Response('Hello World'); $response->withCookie(cookie('name', 'virat', $minutes)); return $response;
} }$value = $request->cookie('name'); echo $value;Step 4 − Add the following line in app/Http/routes.php file.
app/Http/routes.php
Route::get('/cookie/set','CookieController@setCookie'); Route::get('/cookie/get','CookieController@getCookie');Step 5 − Visit the following URL to set the cookie.
http://localhost:8000/cookie/setStep 6 − The output will appear as shown below. The window appearing in the screenshot is taken from firefox but depending on your browser, cookie can also be checked from the cookie option.

Step 7 − Visit the following URL to get the cookie from the above URL.
http://localhost:8000/cookie/getStep 8 − The output will appear as shown in the following image.

-
Laravel 5.1 (2015)
- The first version to provide Long-Term Support (LTS), ensuring two years of bug fixes and three years of security updates. It included features like a new event system and improved job handling.