PHP Class Route, someline-starter

User: florianauderset Date: 09.12.15 Time: 13:47
ファイルを表示 Open project: someline/someline-starter Class Usage Examples

Public Methods

Method Description
any ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new route responding to all verbs.
auth ( ) : void Register the typical authentication routes for an application.
bind ( string $key, string | callable $binder ) : void Add a new route parameter binder.
controller ( string $uri, string $controller, array $names = [] ) : void Route a controller to a URI with wildcard routing.
controllers ( array $controllers ) : void Register an array of controllers with wildcard routing.
createClassBinding ( string $binding ) : Closure Create a class based binding using the IoC container.
current ( ) : Illuminate\Routing\Route Get the currently dispatched route instance.
currentRouteAction ( ) : string | null Get the current route action.
currentRouteName ( ) : string | null Get the current route name.
currentRouteNamed ( string $name ) : boolean Determine if the current route matches a given name.
currentRouteUses ( string $action ) : boolean Determine if the current route action matches a given action.
delete ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new DELETE route with the router.
dispatch ( Illuminate\Http\Request $request ) : Illuminate\Http\Response Dispatch the request to the application.
dispatchToRoute ( Illuminate\Http\Request $request ) : mixed Dispatch the request to a route and return the response.
gatherRouteMiddlewares ( Illuminate\Routing\Route $route ) : array Gather the middleware for the given route.
get ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new GET route with the router.
getCurrentRequest ( ) : Illuminate\Http\Request Get the request currently being dispatched.
getCurrentRoute ( ) : Illuminate\Routing\Route Get the currently dispatched route instance.
getGroupStack ( ) : array Get the current group stack for the router.
getLastGroupPrefix ( ) : string Get the prefix from the last group on the stack.
getMiddleware ( ) : array Get all of the defined middleware short-hand names.
getPatterns ( ) : array Get the global "where" patterns.
getRoutes ( ) : Illuminate\Routing\RouteCollection Get the underlying route collection.
group ( array $attributes, Closure $callback ) : void Create a route group with shared attributes.
has ( string $name ) : boolean Check if a route with the given name exists.
hasGroupStack ( ) : boolean Determine if the router currently has a group stack.
hasMacro ( string $name ) : boolean Checks if macro is registered.
input ( string $key, string $default = null ) : mixed Get a route parameter for the current route.
is ( ) : boolean Alias for the "currentRouteName" method.
macro ( string $name, callable $macro ) : void Register a custom macro.
match ( array | string $methods, string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new route with the given verbs.
matched ( string | callable $callback ) : void Register a route matched event listener.
mergeGroup ( array $new, array $old ) : array Merge the given group attributes.
mergeWithLastGroup ( array $new ) : array Merge the given array with the last group stack.
middleware ( string $name, string $class ) Register a short-hand name for a middleware.
middlewareGroup ( string $name, array $middleware ) Register a group of middleware.
model ( string $key, string $class, Closure | null $callback = null ) : void Register a model binder for a wildcard.
options ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new OPTIONS route with the router.
patch ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new PATCH route with the router.
pattern ( string $key, string $pattern ) : void Set a global where pattern on all routes.
patterns ( array $patterns ) : void Set a group of global where patterns on all routes.
post ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new POST route with the router.
prepareResponse ( Request $request, mixed $response ) : Illuminate\Http\Response Create a response instance from the given value.
prependMiddlewareToGroup ( string $group, string $middleware ) Add a middleware to the beginning of a middleware group.
pushMiddlewareToGroup ( string $group, string $middleware ) Add a middleware to the end of a middleware group.
put ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route Register a new PUT route with the router.
resolveMiddlewareClassName ( string $name ) : string | array Resolve the middleware name to a class name(s) preserving passed parameters.
resource ( string $name, string $controller, array $options = [] ) : void Route a resource to a controller.
resourceParameters ( array $parameters = [] ) : void Set the global resource parameter mapping.
resources ( array $resources ) : void Register an array of resource controllers.
setRoutes ( Illuminate\Routing\RouteCollection $routes ) : void Set the route collection instance.
singularResourceParameters ( ) : void Set the unmapped global resource parameters to singular.
uses ( ) : boolean Alias for the "currentRouteUses" method.

Method Details

any() public static method

Register a new route responding to all verbs.
public static any ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

auth() public static method

Register the typical authentication routes for an application.
public static auth ( ) : void
return void

bind() public static method

Add a new route parameter binder.
public static bind ( string $key, string | callable $binder ) : void
$key string
$binder string | callable
return void

controller() public static method

Route a controller to a URI with wildcard routing.
Deprecation: since version 5.2.
public static controller ( string $uri, string $controller, array $names = [] ) : void
$uri string
$controller string
$names array
return void

controllers() public static method

Register an array of controllers with wildcard routing.
Deprecation: since version 5.2.
public static controllers ( array $controllers ) : void
$controllers array
return void

createClassBinding() public static method

Create a class based binding using the IoC container.
public static createClassBinding ( string $binding ) : Closure
$binding string
return Closure

current() public static method

Get the currently dispatched route instance.
public static current ( ) : Illuminate\Routing\Route
return Illuminate\Routing\Route

currentRouteAction() public static method

Get the current route action.
public static currentRouteAction ( ) : string | null
return string | null

currentRouteName() public static method

Get the current route name.
public static currentRouteName ( ) : string | null
return string | null

currentRouteNamed() public static method

Determine if the current route matches a given name.
public static currentRouteNamed ( string $name ) : boolean
$name string
return boolean

currentRouteUses() public static method

Determine if the current route action matches a given action.
public static currentRouteUses ( string $action ) : boolean
$action string
return boolean

delete() public static method

Register a new DELETE route with the router.
public static delete ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

dispatch() public static method

Dispatch the request to the application.
public static dispatch ( Illuminate\Http\Request $request ) : Illuminate\Http\Response
$request Illuminate\Http\Request
return Illuminate\Http\Response

dispatchToRoute() public static method

Dispatch the request to a route and return the response.
public static dispatchToRoute ( Illuminate\Http\Request $request ) : mixed
$request Illuminate\Http\Request
return mixed

gatherRouteMiddlewares() public static method

Gather the middleware for the given route.
public static gatherRouteMiddlewares ( Illuminate\Routing\Route $route ) : array
$route Illuminate\Routing\Route
return array

get() public static method

Register a new GET route with the router.
public static get ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

getCurrentRequest() public static method

Get the request currently being dispatched.
public static getCurrentRequest ( ) : Illuminate\Http\Request
return Illuminate\Http\Request

getCurrentRoute() public static method

Get the currently dispatched route instance.
public static getCurrentRoute ( ) : Illuminate\Routing\Route
return Illuminate\Routing\Route

getGroupStack() public static method

Get the current group stack for the router.
public static getGroupStack ( ) : array
return array

getLastGroupPrefix() public static method

Get the prefix from the last group on the stack.
public static getLastGroupPrefix ( ) : string
return string

getMiddleware() public static method

Get all of the defined middleware short-hand names.
public static getMiddleware ( ) : array
return array

getPatterns() public static method

Get the global "where" patterns.
public static getPatterns ( ) : array
return array

getRoutes() public static method

Get the underlying route collection.
public static getRoutes ( ) : Illuminate\Routing\RouteCollection
return Illuminate\Routing\RouteCollection

group() public static method

Create a route group with shared attributes.
public static group ( array $attributes, Closure $callback ) : void
$attributes array
$callback Closure
return void

has() public static method

Check if a route with the given name exists.
public static has ( string $name ) : boolean
$name string
return boolean

hasGroupStack() public static method

Determine if the router currently has a group stack.
public static hasGroupStack ( ) : boolean
return boolean

hasMacro() public static method

Checks if macro is registered.
public static hasMacro ( string $name ) : boolean
$name string
return boolean

input() public static method

Get a route parameter for the current route.
public static input ( string $key, string $default = null ) : mixed
$key string
$default string
return mixed

is() public static method

Alias for the "currentRouteName" method.
public static is ( ) : boolean
return boolean

macro() public static method

Register a custom macro.
public static macro ( string $name, callable $macro ) : void
$name string
$macro callable
return void

match() public static method

Register a new route with the given verbs.
public static match ( array | string $methods, string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$methods array | string
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

matched() public static method

Register a route matched event listener.
public static matched ( string | callable $callback ) : void
$callback string | callable
return void

mergeGroup() public static method

Merge the given group attributes.
public static mergeGroup ( array $new, array $old ) : array
$new array
$old array
return array

mergeWithLastGroup() public static method

Merge the given array with the last group stack.
public static mergeWithLastGroup ( array $new ) : array
$new array
return array

middleware() public static method

Register a short-hand name for a middleware.
public static middleware ( string $name, string $class )
$name string
$class string

middlewareGroup() public static method

Register a group of middleware.
public static middlewareGroup ( string $name, array $middleware )
$name string
$middleware array

model() public static method

Register a model binder for a wildcard.
public static model ( string $key, string $class, Closure | null $callback = null ) : void
$key string
$class string
$callback Closure | null
return void

options() public static method

Register a new OPTIONS route with the router.
public static options ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

patch() public static method

Register a new PATCH route with the router.
public static patch ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

pattern() public static method

Set a global where pattern on all routes.
public static pattern ( string $key, string $pattern ) : void
$key string
$pattern string
return void

patterns() public static method

Set a group of global where patterns on all routes.
public static patterns ( array $patterns ) : void
$patterns array
return void

post() public static method

Register a new POST route with the router.
public static post ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

prepareResponse() public static method

Create a response instance from the given value.
public static prepareResponse ( Request $request, mixed $response ) : Illuminate\Http\Response
$request Symfony\Component\HttpFoundation\Request
$response mixed
return Illuminate\Http\Response

prependMiddlewareToGroup() public static method

If the middleware is already in the group, it will not be added again.
public static prependMiddlewareToGroup ( string $group, string $middleware )
$group string
$middleware string

pushMiddlewareToGroup() public static method

If the middleware is already in the group, it will not be added again.
public static pushMiddlewareToGroup ( string $group, string $middleware )
$group string
$middleware string

put() public static method

Register a new PUT route with the router.
public static put ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route

resolveMiddlewareClassName() public static method

Resolve the middleware name to a class name(s) preserving passed parameters.
public static resolveMiddlewareClassName ( string $name ) : string | array
$name string
return string | array

resource() public static method

Route a resource to a controller.
public static resource ( string $name, string $controller, array $options = [] ) : void
$name string
$controller string
$options array
return void

resourceParameters() public static method

Set the global resource parameter mapping.
public static resourceParameters ( array $parameters = [] ) : void
$parameters array
return void

resources() public static method

Register an array of resource controllers.
public static resources ( array $resources ) : void
$resources array
return void

setRoutes() public static method

Set the route collection instance.
public static setRoutes ( Illuminate\Routing\RouteCollection $routes ) : void
$routes Illuminate\Routing\RouteCollection
return void

singularResourceParameters() public static method

Set the unmapped global resource parameters to singular.
public static singularResourceParameters ( ) : void
return void

uses() public static method

Alias for the "currentRouteUses" method.
public static uses ( ) : boolean
return boolean