cineflex/app/Http/Middleware/AtleastRole.php

18 lines
283 B
PHP

<?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);
}
}