Controller
class Controller (View source)
Properties
protected array | $middleware | The middleware registered on the controller. | |
protected array | $beforeFilters | The "before" filters registered on the controller. | |
protected array | $afterFilters | The "after" filters registered on the controller. | |
static protected Router | $router | The router instance. |
Methods
void | middleware(string $middleware, array $options = []) Register middleware on the controller. | |
void | beforeFilter(Closure|string $filter, array $options = []) deprecated Register a "before" filter on the controller. | |
void | afterFilter(Closure|string $filter, array $options = []) deprecated Register an "after" filter on the controller. | |
array | parseFilter(Closure|string $filter, array $options) Parse the given filter and options. | |
string | registerClosureFilter(Closure $filter) Register an anonymous controller filter Closure. | |
string | registerInstanceFilter(string $filter) Register a controller instance method as a filter. | |
bool | isInstanceFilter(mixed $filter) Determine if a filter is a local method on the controller. | |
void | forgetBeforeFilter(string $filter) deprecated Remove the given before filter. | |
void | forgetAfterFilter(string $filter) deprecated Remove the given after filter. | |
array | removeFilter(string $removing, array $current) Remove the given controller filter from the provided filter array. | |
array | getMiddleware() Get the middleware assigned to the controller. | |
array | getBeforeFilters() deprecated Get the registered "before" filters. | |
array | getAfterFilters() deprecated Get the registered "after" filters. | |
static Router | getRouter() Get the router instance. | |
static void | setRouter(Router $router) Set the router instance. | |
Response | callAction(string $method, array $parameters) Execute an action on the controller. | |
mixed | missingMethod(array $parameters = []) Handle calls to missing methods on the controller. | |
mixed | __call(string $method, array $parameters) Handle calls to missing methods on the controller. |
Details
void middleware(string $middleware, array $options = [])
Register middleware on the controller.
void beforeFilter(Closure|string $filter, array $options = []) deprecated
deprecated
Register a "before" filter on the controller.
void afterFilter(Closure|string $filter, array $options = []) deprecated
deprecated
Register an "after" filter on the controller.
protected array parseFilter(Closure|string $filter, array $options)
Parse the given filter and options.
protected string registerClosureFilter(Closure $filter)
Register an anonymous controller filter Closure.
protected string registerInstanceFilter(string $filter)
Register a controller instance method as a filter.
protected bool isInstanceFilter(mixed $filter)
Determine if a filter is a local method on the controller.
void forgetBeforeFilter(string $filter) deprecated
deprecated
Remove the given before filter.
void forgetAfterFilter(string $filter) deprecated
deprecated
Remove the given after filter.
protected array removeFilter(string $removing, array $current)
Remove the given controller filter from the provided filter array.
array getMiddleware()
Get the middleware assigned to the controller.
array getBeforeFilters() deprecated
deprecated
Get the registered "before" filters.
array getAfterFilters() deprecated
deprecated
Get the registered "after" filters.
static Router getRouter()
Get the router instance.
static void setRouter(Router $router)
Set the router instance.
Response callAction(string $method, array $parameters)
Execute an action on the controller.
mixed missingMethod(array $parameters = [])
Handle calls to missing methods on the controller.
mixed __call(string $method, array $parameters)
Handle calls to missing methods on the controller.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Routing/Controller.html