Example #1
0
 /**
  * Revise the scopes of a controller method.
  *
  * Scopes defined on the controller are merged with those in the route definition.
  *
  * @param \Dingo\Api\Routing\Route       $action
  * @param \Illuminate\Routing\Controller $controller
  * @param string                         $method
  *
  * @return void
  */
 protected function reviseScopes(Route $route, $controller, $method)
 {
     $properties = $controller->getProperties();
     if (isset($properties['*']['scopes'])) {
         $route->addScopes($properties['*']['scopes']);
     }
     if (isset($properties[$method]['scopes'])) {
         $route->addScopes($properties[$method]['scopes']);
     }
 }