Answers for "Pass data to controller from middleware"

PHP
0

Pass data to controller from middleware

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class SetName
{
    public function handle(Request $request, Closure $next)
    {
        $request->name = 'Mr. Perfectionist';
        return $next($request);
    }
}
Posted by: Guest on May-06-2021

Code answers related to "Pass data to controller from middleware"

Browse Popular Code Answers by Language