first commit

This commit is contained in:
root
2021-07-10 10:15:55 +00:00
commit 124161318b
7693 changed files with 808583 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Auth;
class IsAdmin
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Auth::user() && Auth::user()->role == 'admin') {
return $next($request);
}
return redirect()->back();
}
}