Laravel - Passing variables from Middleware to controller/route
How can I pass variables from a middleware to a controller or a route that executes such middleware? I saw some post about appending it to the request like this: $request->attributes->add(['key' => $value); also others sugested using flash: Session::flash('key', $value); but I am not sure if that is best practice, or if there is a better way to do this? Here is my Middleware and route: namespace App\Http\Middleware; use Closure; class TwilioWorkspaceCapability { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public