protected function notAllowed(Request $request)
    {
        if ($request->ajax()) {
            return response('Unauthorized.', 401);
        } else {
            $action = $this->config->get('zendacl.action', 'redirect');
            if ($action == 'redirect') {
                $url = $this->config->get('zendacl.redirect', 'auth/login');
                return redirect($url);
            } elseif ($action == 'route') {
                $route = $this->config->get('zendacl.redirect');
                return redirect()->route($route);
            } elseif ($action == 'view') {
                $view = $this->config->get('zendacl.view', 'zendacl::unauthorized');
                return view($view);
            }
        }

    }
protected function notAllowed(Request $request)
    {
        if ($request->ajax()) {
            return response('Unauthorized.', 401);
        } else {
            $action = $this->config->get('zendacl.action', 'redirect');
            if ($action == 'redirect') {
                $url = $this->config->get('zendacl.redirect', 'auth/login');
                return redirect($url);
            } elseif ($action == 'route') {
                $route = $this->config->get('zendacl.redirect');
                return redirect()->route($route);
            } elseif ($action == 'view') {
                $view = $this->config->get('zendacl.view', 'zendacl::unauthorized');
                return view($view);
            }
        }

    }
protected function notAllowed ( Request $ request ) { if ( $ request -> ajax ( ) ) { return response ( 'Unauthorized.' , 401 ) ; } else { $ action = $ this -> config -> get ( 'zendacl.action' , 'redirect' ) ; if ( $ action == 'redirect' ) { $ url = $ this -> config -> get ( 'zendacl.redirect' , 'auth/login' ) ; return redirect ( $ url ) ; } elseif ( $ action == 'route' ) { $ route = $ this -> config -> get ( 'zendacl.redirect' ) ; return redirect ( ) -> route ( $ route ) ; } elseif ( $ action == 'view' ) { $ view = $ this -> config -> get ( 'zendacl.view' , 'zendacl::unauthorized' ) ; return view ( $ view ) ; } } }
Processes not allowed response

@param Request $request

@return \Illuminate\Http\Response
Processes not allowed response