PHP Class JasonLewis\EnhancedRouter\Router

Inheritance: extends Illuminate\Routing\Router
Datei anzeigen Open project: jasonlewis/enhanced-router Class Usage Examples

Protected Properties

Property Type Description
$httpVerbFilters array The HTTP verb to filter bindings.
$routeGroups array Array of route groups.

Public Methods

Method Description
bunch ( Closure $callback ) : JasonLewis\EnhancedRouter\RouteGroup An alias of the group method but without the attributes.
dispatch ( Request $request ) : Response Get the response for a given request.
findPatternFilters ( string $method, string $path ) : array Find the patterned filters matching a request.
getRouteGroups ( ) : array Get the array of route groups.
getRoutes ( ) : RouteCollection Get the route collection instance.
group ( array $attributes, Closure $callback ) : JasonLewis\EnhancedRouter\RouteGroup Create a route group with shared attributes. Overloading this method allows developers to chain requirements and filters to all routes within the group.
on ( string | array $verbs, string | array $names ) : void Tie a registered middleware to an HTTP verb or verbs.

Protected Methods

Method Description
mergeGroupFilters ( Illuminate\Routing\Route $route, JasonLewis\EnhancedRouter\RouteGroup $group ) : void Merge a groups filters onto a route.
mergeRouteGroups ( ) : void Merge route groups into the core route collection.

Method Details

bunch() public method

An alias of the group method but without the attributes.
public bunch ( Closure $callback ) : JasonLewis\EnhancedRouter\RouteGroup
$callback Closure
return JasonLewis\EnhancedRouter\RouteGroup

dispatch() public method

Overloaded so that we can merge route groups.
public dispatch ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

findPatternFilters() public method

Find the patterned filters matching a request.
public findPatternFilters ( string $method, string $path ) : array
$method string
$path string
return array

getRouteGroups() public method

Get the array of route groups.
public getRouteGroups ( ) : array
return array

getRoutes() public method

Overloaded so that we can merge route groups.
public getRoutes ( ) : RouteCollection
return Symfony\Component\Routing\RouteCollection

group() public method

Create a route group with shared attributes. Overloading this method allows developers to chain requirements and filters to all routes within the group.
public group ( array $attributes, Closure $callback ) : JasonLewis\EnhancedRouter\RouteGroup
$attributes array
$callback Closure
return JasonLewis\EnhancedRouter\RouteGroup

mergeGroupFilters() protected method

Merge a groups filters onto a route.
protected mergeGroupFilters ( Illuminate\Routing\Route $route, JasonLewis\EnhancedRouter\RouteGroup $group ) : void
$route Illuminate\Routing\Route
$group JasonLewis\EnhancedRouter\RouteGroup
return void

mergeRouteGroups() protected method

Merge route groups into the core route collection.
protected mergeRouteGroups ( ) : void
return void

on() public method

Tie a registered middleware to an HTTP verb or verbs.
public on ( string | array $verbs, string | array $names ) : void
$verbs string | array
$names string | array
return void

Property Details

$httpVerbFilters protected_oe property

The HTTP verb to filter bindings.
protected array $httpVerbFilters
return array

$routeGroups protected_oe property

Array of route groups.
protected array $routeGroups
return array