Laravel Middleware: Terminable Middleware
Terminable Middleware
<?php
namespace Illuminate\Session\Middleware;
use Closure;
class StartSession
{
public function handle($request, Closure $next)
{
return $next($request);
}
public function terminate($request, $response)
{
// Store the session data...
}
} Once you have defined a terminable middleware, you should add it to the list of route or global middleware in the app/Http/Kernel.php file.
Semantic portal