mega-commit: migrations, controllers, models, etc.
This commit is contained in:
parent
9732135e90
commit
2c6745e812
70 changed files with 2124 additions and 400 deletions
18
app/Http/Middleware/AtleastRole.php
Normal file
18
app/Http/Middleware/AtleastRole.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue