auth = $auth; } /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { //if ($this->auth->getUser()->email !== "student1@aplas.org") { // abort(403, 'Unauthorized action.'); // } if ($this->auth->getUser()->roleid !== "student") { abort(403, 'Unauthorized action.'); } return $next($request); } }