Files
faveo/app/Http/Middleware/CheckRoleAgent.php
Manish Verma 22d3bb4036 Installer updates
Added probe.php
Added new installer views and controllers
Updated AuthController
Updated Middlewares
Updated Commands for installation process
2018-08-07 13:45:46 +05:30

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');
}
}