PHP Class Collective\Annotations\Routing\Annotations\ResourceEndpoint

Inheritance: implements Collective\Annotations\Routing\Annotations\EndpointInterface, use trait EndpointTrait
ファイルを表示 Open project: laravelcollective/annotations

Public Properties

Property Type Description
$classMiddleware array The class level "inherited" middleware that apply to the resource.
$except array The methods that should not be included.
$middleware array This array is keyed by resource method name (index, create, etc).
$name string The name of the resource.
$names array The array of route names for the resource.
$only array The only methods that should be included.
$paths array[ResourcePath] This corresponds to a path for each applicable resource method.
$reflection ReflectionClass The ReflectionClass instance for the controller class.

Protected Properties

Property Type Description
$methods array All of the resource controller methods.

Public Methods

Method Description
__construct ( array $attributes = [] ) : void Create a new route definition instance.
getPaths ( ) : array[AbstractPath] Get all of the path definitions for an endpoint.
hasPaths ( ) : boolean Determine if the endpoint has any paths.
toRouteDefinition ( ) : string Transform the endpoint into a route definition.

Protected Methods

Method Description
buildPaths ( ) : void Build all of the paths for the resource endpoint.
getClassMiddlewareForPath ( ResourcePath $path ) : array Get the class middleware for the given path.
getIncludedMethods ( ) : array Get the methods to be included in the resource.
getMiddleware ( ResourcePath $path ) : array Get all of the middleware for the given path.
getNames ( ResourcePath $path ) : array Get the names for the given path.
getTemplate ( ) : string Get the template for the endpoint.

Method Details

__construct() public method

Create a new route definition instance.
public __construct ( array $attributes = [] ) : void
$attributes array
return void

buildPaths() protected method

Build all of the paths for the resource endpoint.
protected buildPaths ( ) : void
return void

getClassMiddlewareForPath() protected method

Get the class middleware for the given path.
protected getClassMiddlewareForPath ( ResourcePath $path ) : array
$path ResourcePath
return array

getIncludedMethods() protected method

Get the methods to be included in the resource.
protected getIncludedMethods ( ) : array
return array

getMiddleware() protected method

This will also merge in any of the middleware applied at the route level.
protected getMiddleware ( ResourcePath $path ) : array
$path ResourcePath
return array

getNames() protected method

Get the names for the given path.
protected getNames ( ResourcePath $path ) : array
$path ResourcePath
return array

getPaths() public method

Get all of the path definitions for an endpoint.
public getPaths ( ) : array[AbstractPath]
return array[AbstractPath]

getTemplate() protected method

Get the template for the endpoint.
protected getTemplate ( ) : string
return string

hasPaths() public method

Determine if the endpoint has any paths.
public hasPaths ( ) : boolean
return boolean

toRouteDefinition() public method

Transform the endpoint into a route definition.
public toRouteDefinition ( ) : string
return string

Property Details

$classMiddleware public_oe property

The class level "inherited" middleware that apply to the resource.
public array $classMiddleware
return array

$except public_oe property

The methods that should not be included.
public array $except
return array

$methods protected_oe property

All of the resource controller methods.
protected array $methods
return array

$middleware public_oe property

This array is keyed by resource method name (index, create, etc).
public array $middleware
return array

$name public_oe property

The name of the resource.
public string $name
return string

$names public_oe property

The array of route names for the resource.
public array $names
return array

$only public_oe property

The only methods that should be included.
public array $only
return array

$paths public_oe property

This corresponds to a path for each applicable resource method.
public array[ResourcePath] $paths
return array[ResourcePath]

$reflection public_oe property

The ReflectionClass instance for the controller class.
public ReflectionClass $reflection
return ReflectionClass