/**
  * Revise the protected state of a controller method.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @param  \Dingo\Api\Routing\Controller  $controller
  * @param  string  $method
  * @return \Illuminate\Routing\Route
  */
 protected function reviseProtectedMethods($action, $controller, $method)
 {
     if (in_array($method, $controller->getProtectedMethods())) {
         $action['protected'] = true;
     } elseif (in_array($method, $controller->getUnprotectedMethods())) {
         $action['protected'] = false;
     }
     return $action;
 }
Example #2
0
 /**
  * Create a new controller instance.
  *
  * @param  \Dingo\Api\Dispatcher  $api
  * @param  \Dingo\Api\Auth\Shield  $auth
  * @param  \Dingo\Api\Http\ResponseBuilder  $response
  * @return void
  */
 public function __construct(Dispatcher $api, Shield $auth, ResponseBuilder $response)
 {
     parent::__construct($api, $auth, $response);
     $this->_registerModelResolvers();
 }