check()) { return Response::redirect('/login'); } if ($permission !== null && !auth()->can($permission)) { return Response::notFound('You do not have permission to access this page.'); } return null; } }