Call to undefined method Symfony\Component\HttpFoundation\BinaryFileResponse::header() in RevalidateBackHistory.php
问题 I have written a middleware so that the user can't go again in log in page after logging in. Which will redirect to the admin panel if already logged in. Here is the code: class RevalidateBackHistory { public function handle($request, Closure $next) { $response = $next($request); return $response->header('Cache-Control','nocache, no-store, max-age=0, must-revalidate') ->header('Pragma','no-cache') ->header('Expires','Fri, 01 Jan 1990 00:00:00 GMT'); } } i have called it inside a controller