PHP Class SebastiaanLuca\Router\ExtendedRouter

An extension to the application's router to provide extra functionality.
Inheritance: extends Illuminate\Routing\Router, implements Illuminate\Contracts\Routing\Registrar
Afficher le fichier Open project: sebastiaanluca/laravel-router

Protected Properties

Свойство Type Description
$isBootstrapped boolean Indicates if all the service providers have been loaded.
$routeMiddleware array The registered middleware for named routes.

Méthodes publiques

Méthode Description
__construct ( Illuminate\Contracts\Events\Dispatcher $events, Illuminate\Container\Container $container = null ) Create a new Router instance.
linkNamedRouteMiddleware ( ) Link all registered middleware to the corresponding routes.
registerNamedRouteMiddleware ( string | array $routes, string | array $middleware ) Register middleware to add to a named route.

Méthodes protégées

Méthode Description
addMiddlewareToRoute ( string $name, array $middleware ) Add middleware to a named route.

Method Details

__construct() public méthode

Create a new Router instance.
public __construct ( Illuminate\Contracts\Events\Dispatcher $events, Illuminate\Container\Container $container = null )
$events Illuminate\Contracts\Events\Dispatcher
$container Illuminate\Container\Container

addMiddlewareToRoute() protected méthode

Optionally handles wildcard named routes.
protected addMiddlewareToRoute ( string $name, array $middleware )
$name string
$middleware array

linkNamedRouteMiddleware() public méthode

The call to this method is delayed until all service providers have been registered and booted. This way all routes are defined before we try to apply any middleware.

registerNamedRouteMiddleware() public méthode

AKA Route::when() but for middleware. Use an asterisk (*) for wildcard entries. E.g. users.* filters all user routes.
public registerNamedRouteMiddleware ( string | array $routes, string | array $middleware )
$routes string | array
$middleware string | array

Property Details

$isBootstrapped protected_oe property

Indicates if all the service providers have been loaded.
protected bool $isBootstrapped
Résultat boolean

$routeMiddleware protected_oe property

The registered middleware for named routes.
protected array $routeMiddleware
Résultat array