mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
Export and Import vito settings (#606)
* Export and Import vito settings * fix tests
This commit is contained in:
18
app/Http/Middleware/MustBeAdminMiddleware.php
Normal file
18
app/Http/Middleware/MustBeAdminMiddleware.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MustBeAdminMiddleware
|
||||
{
|
||||
public function handle(Request $request, Closure $next): mixed
|
||||
{
|
||||
if (! user()->isAdmin()) {
|
||||
abort(403, 'You must be an admin to perform this action.');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user