class PendingSingletonResourceRegistration

Traits

Properties

static protected array $macros

The registered string macros.

from  Macroable
protected ResourceRegistrar $registrar

The resource registrar.

protected string $name

The resource name.

protected string $controller

The resource controller.

protected array $options

The resource options.

protected bool $registered

The resource's registration status.

Methods

whereAlpha(array|string $parameters)

Specify that the given route parameters must be alphabetic.

whereAlphaNumeric(array|string $parameters)

Specify that the given route parameters must be alphanumeric.

whereNumber(array|string $parameters)

Specify that the given route parameters must be numeric.

whereUlid(array|string $parameters)

Specify that the given route parameters must be ULIDs.

whereUuid(array|string $parameters)

Specify that the given route parameters must be UUIDs.

whereIn(array|string $parameters, array $values)

Specify that the given route parameters must be one of the given values.

assignExpressionToParameters(array|string $parameters, string $expression)

Apply the given regular expression to the given parameters.

static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

__construct(ResourceRegistrar $registrar, string $name, string $controller, array $options)

Create a new pending singleton resource registration instance.

only(array|string $methods)

Set the methods the controller should apply to.

except(array|string $methods)

Set the methods the controller should exclude.

creatable()

Indicate that the resource should have creation and storage routes.

destroyable()

Indicate that the resource should have a deletion route.

names(array|string $names)

Set the route names for controller actions.

name(string $method, string $name)

Set the route name for a controller action.

parameters(array|string $parameters)

Override the route parameter names.

parameter(string $previous, string $new)

Override a route parameter's name.

middleware(mixed $middleware)

Add middleware to the resource routes.

middlewareFor(array|string $methods, array|string $middleware)

Specify middleware that should be added to the specified resource routes.

withoutMiddleware(array|string $middleware)

Specify middleware that should be removed from the resource routes.

withoutMiddlewareFor(array|string $methods, array|string $middleware)

Specify middleware that should be removed from the specified resource routes.

where(mixed $wheres)

Add "where" constraints to the resource routes.

register()

Register the singleton resource route.

static void
flushState()

Flush all static state.

__destruct()

Handle the object's destruction.

Details

CreatesRegularExpressionRouteConstraints whereAlpha(array|string $parameters)

Specify that the given route parameters must be alphabetic.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereAlphaNumeric(array|string $parameters)

Specify that the given route parameters must be alphanumeric.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereNumber(array|string $parameters)

Specify that the given route parameters must be numeric.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereUlid(array|string $parameters)

Specify that the given route parameters must be ULIDs.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereUuid(array|string $parameters)

Specify that the given route parameters must be UUIDs.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereIn(array|string $parameters, array $values)

Specify that the given route parameters must be one of the given values.

Parameters

array|string $parameters
array $values

Return Value

CreatesRegularExpressionRouteConstraints

protected CreatesRegularExpressionRouteConstraints assignExpressionToParameters(array|string $parameters, string $expression)

Apply the given regular expression to the given parameters.

Parameters

array|string $parameters
string $expression

Return Value

CreatesRegularExpressionRouteConstraints

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.

Parameters

string $name
callable|object $macro

Return Value

void

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.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 57
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

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.

Return Value

void

in Macroable at line 78
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in Macroable at line 103
mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

at line 43
__construct(ResourceRegistrar $registrar, string $name, string $controller, array $options)

Create a new pending singleton resource registration instance.

Parameters

ResourceRegistrar $registrar
string $name
string $controller
array $options

at line 54
PendingSingletonResourceRegistration only(array|string $methods)

Set the methods the controller should apply to.

Parameters

array|string $methods

Return Value

PendingSingletonResourceRegistration

at line 64
PendingSingletonResourceRegistration except(array|string $methods)

Set the methods the controller should exclude.

Parameters

array|string $methods

Return Value

PendingSingletonResourceRegistration

at line 74
PendingSingletonResourceRegistration creatable()

Indicate that the resource should have creation and storage routes.

at line 84
PendingSingletonResourceRegistration destroyable()

Indicate that the resource should have a deletion route.

at line 94
PendingSingletonResourceRegistration names(array|string $names)

Set the route names for controller actions.

Parameters

array|string $names

Return Value

PendingSingletonResourceRegistration

at line 104
PendingSingletonResourceRegistration name(string $method, string $name)

Set the route name for a controller action.

Parameters

string $method
string $name

Return Value

PendingSingletonResourceRegistration

at line 114
PendingSingletonResourceRegistration parameters(array|string $parameters)

Override the route parameter names.

Parameters

array|string $parameters

Return Value

PendingSingletonResourceRegistration

at line 124
PendingSingletonResourceRegistration parameter(string $previous, string $new)

Override a route parameter's name.

Parameters

string $previous
string $new

Return Value

PendingSingletonResourceRegistration

at line 134
PendingSingletonResourceRegistration middleware(mixed $middleware)

Add middleware to the resource routes.

Parameters

mixed $middleware

Return Value

PendingSingletonResourceRegistration

at line 159
PendingSingletonResourceRegistration middlewareFor(array|string $methods, array|string $middleware)

Specify middleware that should be added to the specified resource routes.

Parameters

array|string $methods
array|string $middleware

Return Value

PendingSingletonResourceRegistration

at line 181
PendingSingletonResourceRegistration withoutMiddleware(array|string $middleware)

Specify middleware that should be removed from the resource routes.

Parameters

array|string $middleware

Return Value

PendingSingletonResourceRegistration

at line 194
PendingSingletonResourceRegistration withoutMiddlewareFor(array|string $methods, array|string $middleware)

Specify middleware that should be removed from the specified resource routes.

Parameters

array|string $methods
array|string $middleware

Return Value

PendingSingletonResourceRegistration

at line 209
PendingSingletonResourceRegistration where(mixed $wheres)

Add "where" constraints to the resource routes.

Parameters

mixed $wheres

Return Value

PendingSingletonResourceRegistration

at line 219
RouteCollection|null register()

Register the singleton resource route.

Return Value

RouteCollection|null

at line 233
static void flushState()

Flush all static state.

Return Value

void

at line 241
__destruct()

Handle the object's destruction.