 22d3bb4036
			
		
	
	22d3bb4036
	
	
	
		
			
			Added probe.php Added new installer views and controllers Updated AuthController Updated Middlewares Updated Commands for installation process
		
			
				
	
	
		
			31 lines
		
	
	
		
			611 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			611 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Http\Middleware;
 | |
| 
 | |
| use Closure;
 | |
| 
 | |
| /**
 | |
|  * CheckRoleAgent.
 | |
|  *
 | |
|  * @author      Ladybird <info@ladybirdweb.com>
 | |
|  */
 | |
| class CheckRoleAgent
 | |
| {
 | |
|     /**
 | |
|      * Handle an incoming request.
 | |
|      *
 | |
|      * @param \Illuminate\Http\Request $request
 | |
|      * @param \Closure                 $next
 | |
|      *
 | |
|      * @return mixed
 | |
|      */
 | |
|     public function handle($request, Closure $next)
 | |
|     {
 | |
|         if ($request->user()->role == 'agent' || $request->user()->role == 'admin') {
 | |
|             return $next($request);
 | |
|         }
 | |
| 
 | |
|         return redirect('dashboard')->with('fails', 'You are not Autherised');
 | |
|     }
 | |
| }
 |