ControllerDispatcher

class ControllerDispatcher (View source)

Traits

RouteDependencyResolverTrait

Properties

protected Router $router The router instance.
protected Container $container The IoC container instance.

Methods

mixed callWithDependencies(object $instance, string $method)

Call a class method with the resolved dependencies.

from RouteDependencyResolverTrait
array resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

from RouteDependencyResolverTrait
array resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector)

Resolve the given method's type-hinted dependencies.

from RouteDependencyResolverTrait
mixed transformDependency(ReflectionParameter $parameter, array $parameters, array $originalParameters)

Attempt to transform the given parameter into a class instance.

from RouteDependencyResolverTrait
bool vacantEloquentParameter(ReflectionClass $class, array $parameters)

Determine if the given type-hinted class is an implict Eloquent binding.

from RouteDependencyResolverTrait
mixed extractModelIdentifier(ReflectionParameter $parameter, array $originalParameters)

Extract an implicit model binding's key out of the parameter list.

from RouteDependencyResolverTrait
bool alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

from RouteDependencyResolverTrait
void spliceIntoParameters(array $parameters, string $key, mixed $instance)

Splice the given value into the parameter list.

from RouteDependencyResolverTrait
void __construct(Router $router, Container $container = null)

Create a new controller dispatcher instance.

mixed dispatch(Route $route, Request $request, string $controller, string $method)

Dispatch a request to a given controller and method.

mixed makeController(string $controller)

Make a controller instance via the IoC container.

mixed callWithinStack(Controller $instance, Route $route, Request $request, string $method)

Call the given controller instance method.

array getMiddleware(Controller $instance, string $method)

Get the middleware for the controller instance.

bool methodExcludedByOptions(string $method, array $options)

Determine if the given options exclude a particular method.

mixed call(Controller $instance, Route $route, string $method)

Call the given controller instance method.

mixed before(Controller $instance, Route $route, Request $request, string $method)

Call the "before" filters for the controller.

mixed assignAfter(Controller $instance, Route $route, Request $request, string $method)

Apply the applicable after filters to the route.

string getAssignableAfter(Closure|string $filter)

Get the assignable after filter for the route.

bool filterApplies(array $filter, Request $request, string $method)

Determine if the given filter applies to the request.

bool filterFailsMethod(array $filter, Request $request, string $method)

Determine if the filter fails the method constraints.

bool filterFailsOn(array $filter, Request $request, string $method)

Determine if the filter fails the "on" constraint.

mixed callFilter(array $filter, Route $route, Request $request)

Call the given controller filter method.

Details

protected mixed callWithDependencies(object $instance, string $method)

Call a class method with the resolved dependencies.

Parameters

object $instance
string $method

Return Value

mixed

protected array resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

Parameters

array $parameters
object $instance
string $method

Return Value

array

array resolveMethodDependencies(array $parameters, ReflectionFunctionAbstract $reflector)

Resolve the given method's type-hinted dependencies.

Parameters

array $parameters
ReflectionFunctionAbstract $reflector

Return Value

array

protected mixed transformDependency(ReflectionParameter $parameter, array $parameters, array $originalParameters)

Attempt to transform the given parameter into a class instance.

Parameters

ReflectionParameter $parameter
array $parameters
array $originalParameters

Return Value

mixed

protected bool vacantEloquentParameter(ReflectionClass $class, array $parameters)

Determine if the given type-hinted class is an implict Eloquent binding.

Must not already be resolved in the parameter list by an explicit model binding.

Parameters

ReflectionClass $class
array $parameters

Return Value

bool

protected mixed extractModelIdentifier(ReflectionParameter $parameter, array $originalParameters)

Extract an implicit model binding's key out of the parameter list.

Parameters

ReflectionParameter $parameter
array $originalParameters

Return Value

mixed

protected bool alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

Parameters

string $class
array $parameters

Return Value

bool

protected void spliceIntoParameters(array $parameters, string $key, mixed $instance)

Splice the given value into the parameter list.

Parameters

array $parameters
string $key
mixed $instance

Return Value

void

void __construct(Router $router, Container $container = null)

Create a new controller dispatcher instance.

Parameters

Router $router
Container $container

Return Value

void

mixed dispatch(Route $route, Request $request, string $controller, string $method)

Dispatch a request to a given controller and method.

Parameters

Route $route
Request $request
string $controller
string $method

Return Value

mixed

protected mixed makeController(string $controller)

Make a controller instance via the IoC container.

Parameters

string $controller

Return Value

mixed

protected mixed callWithinStack(Controller $instance, Route $route, Request $request, string $method)

Call the given controller instance method.

Parameters

Controller $instance
Route $route
Request $request
string $method

Return Value

mixed

protected array getMiddleware(Controller $instance, string $method)

Get the middleware for the controller instance.

Parameters

Controller $instance
string $method

Return Value

array

bool methodExcludedByOptions(string $method, array $options)

Determine if the given options exclude a particular method.

Parameters

string $method
array $options

Return Value

bool

protected mixed call(Controller $instance, Route $route, string $method)

Call the given controller instance method.

Parameters

Controller $instance
Route $route
string $method

Return Value

mixed

protected mixed before(Controller $instance, Route $route, Request $request, string $method)

Call the "before" filters for the controller.

Parameters

Controller $instance
Route $route
Request $request
string $method

Return Value

mixed

protected mixed assignAfter(Controller $instance, Route $route, Request $request, string $method)

Apply the applicable after filters to the route.

Parameters

Controller $instance
Route $route
Request $request
string $method

Return Value

mixed

protected string getAssignableAfter(Closure|string $filter)

Get the assignable after filter for the route.

Parameters

Closure|string $filter

Return Value

string

protected bool filterApplies(array $filter, Request $request, string $method)

Determine if the given filter applies to the request.

Parameters

array $filter
Request $request
string $method

Return Value

bool

protected bool filterFailsMethod(array $filter, Request $request, string $method)

Determine if the filter fails the method constraints.

Parameters

array $filter
Request $request
string $method

Return Value

bool

protected bool filterFailsOn(array $filter, Request $request, string $method)

Determine if the filter fails the "on" constraint.

Parameters

array $filter
Request $request
string $method

Return Value

bool

protected mixed callFilter(array $filter, Route $route, Request $request)

Call the given controller filter method.

Parameters

array $filter
Route $route
Request $request

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Routing/ControllerDispatcher.html