RouteRegistrar
class RouteRegistrar
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected Router | $router | The router instance. |
|
| protected array | $attributes | The attributes to pass on to the router. |
|
| protected string[] | $passthru | The methods to dynamically pass through to the router. |
|
| protected string[] | $allowedAttributes | The attributes that can be set through this class. |
|
| protected array | $aliases | The attributes that are aliased. |
Methods
Specify that the given route parameters must be alphabetic.
Specify that the given route parameters must be alphanumeric.
Specify that the given route parameters must be numeric.
Specify that the given route parameters must be ULIDs.
Specify that the given route parameters must be UUIDs.
Specify that the given route parameters must be one of the given values.
Apply the given regular expression to the given parameters.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls into the route registrar.
Set the value for a given attribute.
Route a resource to a controller.
Route an API resource to a controller.
Route a singleton resource to a controller.
Route an API singleton resource to a controller.
Register a new route with the router.
Compile the action into an array including the attributes.
Flush all static state.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
in
CreatesRegularExpressionRouteConstraints at line 16
CreatesRegularExpressionRouteConstraints
whereAlpha(array|string $parameters)
Specify that the given route parameters must be alphabetic.
in
CreatesRegularExpressionRouteConstraints at line 24
CreatesRegularExpressionRouteConstraints
whereAlphaNumeric(array|string $parameters)
Specify that the given route parameters must be alphanumeric.
in
CreatesRegularExpressionRouteConstraints at line 32
CreatesRegularExpressionRouteConstraints
whereNumber(array|string $parameters)
Specify that the given route parameters must be numeric.
in
CreatesRegularExpressionRouteConstraints at line 40
CreatesRegularExpressionRouteConstraints
whereUlid(array|string $parameters)
Specify that the given route parameters must be ULIDs.
in
CreatesRegularExpressionRouteConstraints at line 48
CreatesRegularExpressionRouteConstraints
whereUuid(array|string $parameters)
Specify that the given route parameters must be UUIDs.
in
CreatesRegularExpressionRouteConstraints at line 56
CreatesRegularExpressionRouteConstraints
whereIn(array|string $parameters, array $values)
Specify that the given route parameters must be one of the given values.
in
CreatesRegularExpressionRouteConstraints at line 69
protected CreatesRegularExpressionRouteConstraints
assignExpressionToParameters(array|string $parameters, string $expression)
Apply the given regular expression to the given parameters.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 248
mixed
__call(string $method, array $parameters)
Dynamically handle calls into the route registrar.
at line 98
__construct(Router $router)
Create a new route registrar instance.
at line 108
RouteRegistrar
attribute(string $key, mixed $value)
Set the value for a given attribute.
at line 147
PendingResourceRegistration
resource(string $name, string $controller, array $options = [])
Route a resource to a controller.
at line 155
PendingResourceRegistration
apiResource(string $name, string $controller, array $options = [])
Route an API resource to a controller.
at line 163
PendingSingletonResourceRegistration
singleton(string $name, string $controller, array $options = [])
Route a singleton resource to a controller.
at line 171
PendingSingletonResourceRegistration
apiSingleton(string $name, string $controller, array $options = [])
Route an API singleton resource to a controller.
at line 179
RouteRegistrar
group(Closure|array|string $callback)
Create a route group with shared attributes.
at line 189
Route
match(array|string $methods, string $uri, Closure|array|string|null $action = null)
Register a new route with the given verbs.
at line 197
protected Route
registerRoute(string $method, string $uri, Closure|array|string|null $action = null)
Register a new route with the router.
at line 209
protected array
compileAction(Closure|array|string|null $action)
Compile the action into an array including the attributes.
at line 236
static void
flushState()
Flush all static state.
at line 37
Route
any(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
Route
delete(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
Route
get(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
Route
options(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
Route
patch(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
Route
post(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
Route
put(string $uri, Closure|array|string|null $action = 'null')
No description
at line 37
RouteRegistrar
as(string $value)
No description
at line 37
RouteRegistrar
can(UnitEnum|string $ability, array|string $models = '[]')
No description
at line 37
RouteRegistrar
controller(string $controller)
No description
at line 37
RouteRegistrar
domain(BackedEnum|string $value)
No description
at line 37
RouteRegistrar
middleware(null|array|string $middleware)
No description
at line 37
RouteRegistrar
missing(Closure $missing)
No description
at line 37
RouteRegistrar
name(BackedEnum|string $value)
No description
at line 37
RouteRegistrar
namespace(null|string $value)
No description
at line 37
RouteRegistrar
prefix(string $prefix)
No description
at line 37
RouteRegistrar
scopeBindings()
No description
at line 37
static void
where(array $where)
No description
at line 37
RouteRegistrar
withoutMiddleware(array|string $middleware)
No description
at line 37
RouteRegistrar
withoutScopedBindings()
No description