class PendingSingletonResourceRegistration (View source)

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

$this
whereAlpha(array|string $parameters)

Specify that the given route parameters must be alphabetic.

$this
whereAlphaNumeric(array|string $parameters)

Specify that the given route parameters must be alphanumeric.

$this
whereNumber(array|string $parameters)

Specify that the given route parameters must be numeric.

$this
whereUlid(array|string $parameters)

Specify that the given route parameters must be ULIDs.

$this
whereUuid(array|string $parameters)

Specify that the given route parameters must be UUIDs.

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

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

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

Apply the given regular expression to the given parameters.

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

Register a custom macro.

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

Mix another object into the class.

static bool
hasMacro(string $name)

Checks 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.

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

Create a new pending singleton resource registration instance.

only(array|string|mixed $methods)

Set the methods the controller should apply to.

except(array|string|mixed $methods)

Set the methods the controller should exclude.

$this
creatable()

Indicate that the resource should have creation and storage routes.

$this
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.

$this|array
withoutMiddleware(array|string $middleware)

Specify middleware that should be removed from the resource routes.

where(mixed $wheres)

Add "where" constraints to the resource routes.

register()

Register the singleton resource route.

void
__destruct()

Handle the object's destruction.

Details

$this whereAlpha(array|string $parameters)

Specify that the given route parameters must be alphabetic.

Parameters

array|string $parameters

Return Value

$this

$this whereAlphaNumeric(array|string $parameters)

Specify that the given route parameters must be alphanumeric.

Parameters

array|string $parameters

Return Value

$this

$this whereNumber(array|string $parameters)

Specify that the given route parameters must be numeric.

Parameters

array|string $parameters

Return Value

$this

$this whereUlid(array|string $parameters)

Specify that the given route parameters must be ULIDs.

Parameters

array|string $parameters

Return Value

$this

$this whereUuid(array|string $parameters)

Specify that the given route parameters must be UUIDs.

Parameters

array|string $parameters

Return Value

$this

$this 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

$this

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

Apply the given regular expression to the given parameters.

Parameters

array|string $parameters
string $expression

Return Value

$this

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

Register a custom macro.

Parameters

string $name
object|callable $macro

Return Value

void

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

Mix another object into the class.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static void flushMacros()

Flush the existing macros.

Return Value

void

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

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

void __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

Return Value

void

PendingSingletonResourceRegistration only(array|string|mixed $methods)

Set the methods the controller should apply to.

Parameters

array|string|mixed $methods

Return Value

PendingSingletonResourceRegistration

PendingSingletonResourceRegistration except(array|string|mixed $methods)

Set the methods the controller should exclude.

Parameters

array|string|mixed $methods

Return Value

PendingSingletonResourceRegistration

$this creatable()

Indicate that the resource should have creation and storage routes.

Return Value

$this

$this destroyable()

Indicate that the resource should have a deletion route.

Return Value

$this

PendingSingletonResourceRegistration names(array|string $names)

Set the route names for controller actions.

Parameters

array|string $names

Return Value

PendingSingletonResourceRegistration

PendingSingletonResourceRegistration name(string $method, string $name)

Set the route name for a controller action.

Parameters

string $method
string $name

Return Value

PendingSingletonResourceRegistration

PendingSingletonResourceRegistration parameters(array|string $parameters)

Override the route parameter names.

Parameters

array|string $parameters

Return Value

PendingSingletonResourceRegistration

PendingSingletonResourceRegistration parameter(string $previous, string $new)

Override a route parameter's name.

Parameters

string $previous
string $new

Return Value

PendingSingletonResourceRegistration

PendingSingletonResourceRegistration middleware(mixed $middleware)

Add middleware to the resource routes.

Parameters

mixed $middleware

Return Value

PendingSingletonResourceRegistration

$this|array withoutMiddleware(array|string $middleware)

Specify middleware that should be removed from the resource routes.

Parameters

array|string $middleware

Return Value

$this|array

PendingSingletonResourceRegistration where(mixed $wheres)

Add "where" constraints to the resource routes.

Parameters

mixed $wheres

Return Value

PendingSingletonResourceRegistration

RouteCollection register()

Register the singleton resource route.

Return Value

RouteCollection

void __destruct()

Handle the object's destruction.

Return Value

void