fix migration && add seeder && add is_admin

This commit is contained in:
jenoh
2020-03-13 10:48:18 +01:00
parent cae091e1ec
commit 7f4c5d47df
9 changed files with 424 additions and 32 deletions

View File

@ -0,0 +1,47 @@
<?php
namespace App\Http\Middleware;
use Closure;
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()->is_admin == 1){
return $next($request);
}
return redirect(home)->with(error,"You don't have admin access.");
}
}