cineflex/app/Http/Middleware/AtleastRole.php

19 lines
283 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Http\Middleware;
use Closure;
class AtleastRole
{
public function handle($request, Closure $next, $role)
{
if (!auth()->user()->atleast($role)) {
return redirect()->route('home');
}
return $next($request);
}
}