class Route extends Facade

Properties

static protected $app

The application instance being facaded.

from  Facade
static protected array $resolvedInstance

The resolved object instances.

from  Facade
static protected bool $cached

Indicates if the resolved instance should be cached.

from  Facade

Methods

static void
resolved(Closure $callback)

Run a Closure when the facade has been resolved.

from  Facade
static 
spy()

Convert the facade into a Mockery spy.

from  Facade
static 
partialMock()

Initiate a partial mock on the facade.

from  Facade
static 
shouldReceive()

Initiate a mock expectation on the facade.

from  Facade
static 
expects()

Initiate a mock expectation on the facade.

from  Facade
static 
createFreshMockInstance()

Create a fresh mock instance for the given class.

from  Facade
static 
createMock()

Create a fresh mock instance for the given class.

from  Facade
static bool
isMock()

Determines whether a mock is set as the instance of the facade.

from  Facade
static string|null
getMockableClass()

Get the mockable class for the bound instance.

from  Facade
static 
swap(mixed $instance)

Hotswap the underlying instance behind the facade.

from  Facade
static bool
isFake()

Determines whether a "fake" has been set as the facade instance.

from  Facade
static mixed
getFacadeRoot()

Get the root object behind the facade.

from  Facade
static string
getFacadeAccessor()

Get the registered name of the component.

static mixed
resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

from  Facade
static void
clearResolvedInstance(string|null $name = null)

Clear a resolved facade instance.

from  Facade
static void
clearResolvedInstances()

Clear all of the resolved instances.

from  Facade
static Collection
defaultAliases()

Get the application default aliases.

from  Facade
static 
getFacadeApplication()

Get the application instance behind the facade.

from  Facade
static void
setFacadeApplication(mixed $app)

Set the application instance.

from  Facade
static 
__callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

from  Facade
static Route
get(string $uri, callable|array|string|null $action = 'null')

No description

static Route
post(string $uri, callable|array|string|null $action = 'null')

No description

static Route
put(string $uri, callable|array|string|null $action = 'null')

No description

static Route
patch(string $uri, callable|array|string|null $action = 'null')

No description

static Route
delete(string $uri, callable|array|string|null $action = 'null')

No description

static Route
options(string $uri, callable|array|string|null $action = 'null')

No description

static Route
any(string $uri, callable|array|string|null $action = 'null')

No description

static Route
fallback(callable|array|string|null $action)

No description

static Route
redirect(string $uri, string $destination, int $status = '302')

No description

static Route
permanentRedirect(string $uri, string $destination)

No description

static Route
view(string $uri, string $view, array $data = '[]', array|int $status = '200', array $headers = '[]')

No description

static Route
match(array|string $methods, string $uri, callable|array|string|null $action = 'null')

No description

static void
resources(array $resources, array $options = '[]')

No description

static void
softDeletableResources(array $resources, array $options = '[]')

No description

resource(string $name, string $controller, array $options = '[]')

No description

static void
apiResources(array $resources, array $options = '[]')

No description

apiResource(string $name, string $controller, array $options = '[]')

No description

static void
singletons(array $singletons, array $options = '[]')

No description

singleton(string $name, string $controller, array $options = '[]')

No description

static void
apiSingletons(array $singletons, array $options = '[]')

No description

apiSingleton(string $name, string $controller, array $options = '[]')

No description

static Router
group(array $attributes, Closure|array|string $routes)

No description

static array
mergeWithLastGroup(array $new, bool $prependExistingPrefix = 'true')

No description

static string
getLastGroupPrefix()

No description

static Route
addRoute(array|string $methods, string $uri, callable|array|string|null $action)

No description

static Route
newRoute(array|string $methods, string $uri, mixed $action)

No description

static Response
respondWithRoute(string $name)

No description

static Response
dispatch(Request $request)

No description

static Response
dispatchToRoute(Request $request)

No description

static Response
dispatchToCallback(Request $request, Closure $callback)

No description

static void
array()

<string, string> getPatterns()

static Response
prepareResponse(Request $request, mixed $response)

No description

static Response
toResponse(Request $request, mixed $response)

No description

static Route
substituteBindings(Route $route)

No description

static mixed
substituteImplicitBindings(Route $route)

No description

static Router
substituteImplicitBindingsUsing(callable $callback)

No description

static void
matched(callable|string $callback)

No description

static Router
aliasMiddleware(string $name, Closure|string $class)

No description

static bool
hasMiddlewareGroup(string $name)

No description

static Router
middlewareGroup(string $name, array $middleware)

No description

static Router
prependMiddlewareToGroup(string $group, string $middleware)

No description

static Router
pushMiddlewareToGroup(string $group, string $middleware)

No description

static Router
removeMiddlewareFromGroup(string $group, array|string $middleware)

No description

static Router
flushMiddlewareGroups()

No description

static void
bind(string $key, callable|string $binder)

No description

static void
model(string $key, string $class, Closure|null $callback = 'null')

No description

static Closure|null
getBindingCallback(string $key)

No description

static void
pattern(string $key, string $pattern)

No description

static void
patterns(array $patterns)

No description

static bool
hasGroupStack()

No description

static array
getGroupStack()

No description

static mixed
input(string $key, string|null $default = 'null')

No description

static Request|null
getCurrentRequest()

No description

static Route|null
getCurrentRoute()

No description

static Route|null
current()

No description

static bool
has(array|string $name)

No description

static string|null
currentRouteName()

No description

static bool
is(mixed ...$patterns)

No description

static bool
currentRouteNamed(mixed ...$patterns)

No description

static string|null
currentRouteAction()

No description

static bool
uses(array|string ...$patterns)

No description

static bool
currentRouteUses(string $action)

No description

static void
singularResourceParameters(bool $singular = 'true')

No description

static void
resourceParameters(array $parameters = '[]')

No description

static array|null
resourceVerbs(array $verbs = '[]')

No description

getRoutes()

No description

static void
setRoutes(RouteCollection $routes)

No description

static void
setCompiledRoutes(array $routes)

No description

static void
compileAndWarm()

No description

static void
warmUp()

No description

static array
uniqueMiddleware(array $middleware)

No description

static Router
setContainer(Container $container)

No description

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

No description

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

No description

static bool
hasMacro(string $name)

No description

static void
flushMacros()

No description

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

No description

static Router
tap(null|callable $callback = 'null')

No description

static RouteRegistrar
attribute(string $key, mixed $value)

No description

static RouteRegistrar
whereAlpha(array|string $parameters)

No description

static RouteRegistrar
whereAlphaNumeric(array|string $parameters)

No description

static RouteRegistrar
whereNumber(array|string $parameters)

No description

static RouteRegistrar
whereUlid(array|string $parameters)

No description

static RouteRegistrar
whereUuid(array|string $parameters)

No description

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

No description

static RouteRegistrar
as(string $value)

No description

static RouteRegistrar
can(UnitEnum|string $ability, array|string $models = '[]')

No description

static RouteRegistrar
controller(string $controller)

No description

static RouteRegistrar
domain(BackedEnum|string $value)

No description

static RouteRegistrar
middleware(null|array|string $middleware)

No description

static RouteRegistrar
missing(Closure $missing)

No description

static RouteRegistrar
name(BackedEnum|string $value)

No description

static RouteRegistrar
namespace(null|string $value)

No description

static RouteRegistrar
prefix(string $prefix)

No description

static RouteRegistrar
scopeBindings()

No description

static RouteRegistrar
where(array $where)

No description

static RouteRegistrar
withoutMiddleware(array|string $middleware)

No description

static RouteRegistrar
withoutScopedBindings()

No description

Details

in Facade at line 55
static void resolved(Closure $callback)

Run a Closure when the facade has been resolved.

Boot-only. The callback is registered on the worker-global container and runs for every subsequent resolution of the facade accessor.

Parameters

Closure $callback

Return Value

void

in Facade at line 71
static spy()

Convert the facade into a Mockery spy.

in Facade at line 89
static partialMock()

Initiate a partial mock on the facade.

Tests only. Swaps the resolved facade instance for the worker lifetime.

in Facade at line 105
static shouldReceive()

Initiate a mock expectation on the facade.

Tests only. Swaps the resolved facade instance for the worker lifetime.

in Facade at line 121
static expects()

Initiate a mock expectation on the facade.

Tests only. Swaps the resolved facade instance for the worker lifetime.

in Facade at line 135
static protected createFreshMockInstance()

Create a fresh mock instance for the given class.

in Facade at line 147
static protected createMock()

Create a fresh mock instance for the given class.

in Facade at line 157
static protected bool isMock()

Determines whether a mock is set as the instance of the facade.

Return Value

bool

in Facade at line 168
static protected string|null getMockableClass()

Get the mockable class for the bound instance.

Return Value

string|null

in Facade at line 184
static swap(mixed $instance)

Hotswap the underlying instance behind the facade.

Tests only. Replaces the worker-wide resolved facade instance and container binding; runtime use races across coroutines and changes every subsequent facade call.

Parameters

mixed $instance

in Facade at line 196
static bool isFake()

Determines whether a "fake" has been set as the facade instance.

Return Value

bool

in Facade at line 207
static mixed getFacadeRoot()

Get the root object behind the facade.

Return Value

mixed

at line 115
static protected string getFacadeAccessor()

Get the registered name of the component.

Return Value

string

in Facade at line 223
static protected mixed resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

Parameters

string $name

Return Value

mixed

in Facade at line 246
static void clearResolvedInstance(string|null $name = null)

Clear a resolved facade instance.

Boot or tests only. Clears a worker-wide facade cache entry; concurrent coroutines may still hold the previous resolved instance.

Parameters

string|null $name

Return Value

void

in Facade at line 257
static void clearResolvedInstances()

Clear all of the resolved instances.

Boot or tests only. Clears the worker-wide facade cache; concurrent coroutines may still hold previously resolved instances.

Return Value

void

in Facade at line 265
static Collection defaultAliases()

Get the application default aliases.

Return Value

Collection

in Facade at line 324
static getFacadeApplication()

Get the application instance behind the facade.

in Facade at line 337
static void setFacadeApplication(mixed $app)

Set the application instance.

Tests only. Replaces the worker-wide facade application reference; runtime use races across coroutines and breaks every facade lookup.

Parameters

mixed $app

Return Value

void

in Facade at line 347
static __callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

Parameters

string $method
array $args

Exceptions

RuntimeException

at line 113
static Route get(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route post(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route put(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route patch(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route delete(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route options(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route any(string $uri, callable|array|string|null $action = 'null')

No description

Parameters

string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route fallback(callable|array|string|null $action)

No description

Parameters

callable|array|string|null $action

Return Value

Route

at line 113
static Route redirect(string $uri, string $destination, int $status = '302')

No description

Parameters

string $uri
string $destination
int $status

Return Value

Route

at line 113
static Route permanentRedirect(string $uri, string $destination)

No description

Parameters

string $uri
string $destination

Return Value

Route

at line 113
static Route view(string $uri, string $view, array $data = '[]', array|int $status = '200', array $headers = '[]')

No description

Parameters

string $uri
string $view
array $data
array|int $status
array $headers

Return Value

Route

at line 113
static Route match(array|string $methods, string $uri, callable|array|string|null $action = 'null')

No description

Parameters

array|string $methods
string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static void resources(array $resources, array $options = '[]')

No description

Parameters

array $resources
array $options

Return Value

void

at line 113
static void softDeletableResources(array $resources, array $options = '[]')

No description

Parameters

array $resources
array $options

Return Value

void

at line 113
static PendingResourceRegistration resource(string $name, string $controller, array $options = '[]')

No description

Parameters

string $name
string $controller
array $options

Return Value

PendingResourceRegistration

at line 113
static void apiResources(array $resources, array $options = '[]')

No description

Parameters

array $resources
array $options

Return Value

void

at line 113
static PendingResourceRegistration apiResource(string $name, string $controller, array $options = '[]')

No description

Parameters

string $name
string $controller
array $options

Return Value

PendingResourceRegistration

at line 113
static void singletons(array $singletons, array $options = '[]')

No description

Parameters

array $singletons
array $options

Return Value

void

at line 113
static PendingSingletonResourceRegistration singleton(string $name, string $controller, array $options = '[]')

No description

Parameters

string $name
string $controller
array $options

Return Value

PendingSingletonResourceRegistration

at line 113
static void apiSingletons(array $singletons, array $options = '[]')

No description

Parameters

array $singletons
array $options

Return Value

void

at line 113
static PendingSingletonResourceRegistration apiSingleton(string $name, string $controller, array $options = '[]')

No description

Parameters

string $name
string $controller
array $options

Return Value

PendingSingletonResourceRegistration

at line 113
static Router group(array $attributes, Closure|array|string $routes)

No description

Parameters

array $attributes
Closure|array|string $routes

Return Value

Router

at line 113
static array mergeWithLastGroup(array $new, bool $prependExistingPrefix = 'true')

No description

Parameters

array $new
bool $prependExistingPrefix

Return Value

array

at line 113
static string getLastGroupPrefix()

No description

Return Value

string

at line 113
static Route addRoute(array|string $methods, string $uri, callable|array|string|null $action)

No description

Parameters

array|string $methods
string $uri
callable|array|string|null $action

Return Value

Route

at line 113
static Route newRoute(array|string $methods, string $uri, mixed $action)

No description

Parameters

array|string $methods
string $uri
mixed $action

Return Value

Route

at line 113
static Response respondWithRoute(string $name)

No description

Parameters

string $name

Return Value

Response

at line 113
static Response dispatch(Request $request)

No description

Parameters

Request $request

Return Value

Response

at line 113
static Response dispatchToRoute(Request $request)

No description

Parameters

Request $request

Return Value

Response

at line 113
static Response dispatchToCallback(Request $request, Closure $callback)

No description

Parameters

Request $request
Closure $callback

Return Value

Response

at line 113
static void array()

<string, string> getPatterns()

Return Value

void

at line 113
static Response prepareResponse(Request $request, mixed $response)

No description

Parameters

Request $request
mixed $response

Return Value

Response

at line 113
static Response toResponse(Request $request, mixed $response)

No description

Parameters

Request $request
mixed $response

Return Value

Response

at line 113
static Route substituteBindings(Route $route)

No description

Parameters

Route $route

Return Value

Route

at line 113
static mixed substituteImplicitBindings(Route $route)

No description

Parameters

Route $route

Return Value

mixed

at line 113
static Router substituteImplicitBindingsUsing(callable $callback)

No description

Parameters

callable $callback

Return Value

Router

at line 113
static void matched(callable|string $callback)

No description

Parameters

callable|string $callback

Return Value

void

at line 113
static Router aliasMiddleware(string $name, Closure|string $class)

No description

Parameters

string $name
Closure|string $class

Return Value

Router

at line 113
static bool hasMiddlewareGroup(string $name)

No description

Parameters

string $name

Return Value

bool

at line 113
static Router middlewareGroup(string $name, array $middleware)

No description

Parameters

string $name
array $middleware

Return Value

Router

at line 113
static Router prependMiddlewareToGroup(string $group, string $middleware)

No description

Parameters

string $group
string $middleware

Return Value

Router

at line 113
static Router pushMiddlewareToGroup(string $group, string $middleware)

No description

Parameters

string $group
string $middleware

Return Value

Router

at line 113
static Router removeMiddlewareFromGroup(string $group, array|string $middleware)

No description

Parameters

string $group
array|string $middleware

Return Value

Router

at line 113
static Router flushMiddlewareGroups()

No description

Return Value

Router

at line 113
static void bind(string $key, callable|string $binder)

No description

Parameters

string $key
callable|string $binder

Return Value

void

at line 113
static void model(string $key, string $class, Closure|null $callback = 'null')

No description

Parameters

string $key
string $class
Closure|null $callback

Return Value

void

at line 113
static Closure|null getBindingCallback(string $key)

No description

Parameters

string $key

Return Value

Closure|null

at line 113
static void pattern(string $key, string $pattern)

No description

Parameters

string $key
string $pattern

Return Value

void

at line 113
static void patterns(array $patterns)

No description

Parameters

array $patterns

Return Value

void

at line 113
static bool hasGroupStack()

No description

Return Value

bool

at line 113
static array getGroupStack()

No description

Return Value

array

at line 113
static mixed input(string $key, string|null $default = 'null')

No description

Parameters

string $key
string|null $default

Return Value

mixed

at line 113
static Request|null getCurrentRequest()

No description

Return Value

Request|null

at line 113
static Route|null getCurrentRoute()

No description

Return Value

Route|null

at line 113
static Route|null current()

No description

Return Value

Route|null

at line 113
static bool has(array|string $name)

No description

Parameters

array|string $name

Return Value

bool

at line 113
static string|null currentRouteName()

No description

Return Value

string|null

at line 113
static bool is(mixed ...$patterns)

No description

Parameters

mixed ...$patterns

Return Value

bool

at line 113
static bool currentRouteNamed(mixed ...$patterns)

No description

Parameters

mixed ...$patterns

Return Value

bool

at line 113
static string|null currentRouteAction()

No description

Return Value

string|null

at line 113
static bool uses(array|string ...$patterns)

No description

Parameters

array|string ...$patterns

Return Value

bool

at line 113
static bool currentRouteUses(string $action)

No description

Parameters

string $action

Return Value

bool

at line 113
static void singularResourceParameters(bool $singular = 'true')

No description

Parameters

bool $singular

Return Value

void

at line 113
static void resourceParameters(array $parameters = '[]')

No description

Parameters

array $parameters

Return Value

void

at line 113
static array|null resourceVerbs(array $verbs = '[]')

No description

Parameters

array $verbs

Return Value

array|null

at line 113
static RouteCollectionInterface getRoutes()

No description

at line 113
static void setRoutes(RouteCollection $routes)

No description

Parameters

RouteCollection $routes

Return Value

void

at line 113
static void setCompiledRoutes(array $routes)

No description

Parameters

array $routes

Return Value

void

at line 113
static void compileAndWarm()

No description

Return Value

void

at line 113
static void warmUp()

No description

Return Value

void

at line 113
static array uniqueMiddleware(array $middleware)

No description

Parameters

array $middleware

Return Value

array

at line 113
static Router setContainer(Container $container)

No description

Parameters

Container $container

Return Value

Router

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

No description

Parameters

string $name
callable|object $macro

Return Value

void

at line 113
static void mixin(object $mixin, bool $replace = 'true')

No description

Parameters

object $mixin
bool $replace

Return Value

void

at line 113
static bool hasMacro(string $name)

No description

Parameters

string $name

Return Value

bool

at line 113
static void flushMacros()

No description

Return Value

void

at line 113
static mixed macroCall(string $method, array $parameters)

No description

Parameters

string $method
array $parameters

Return Value

mixed

at line 113
static Router tap(null|callable $callback = 'null')

No description

Parameters

null|callable $callback

Return Value

Router

at line 113
static RouteRegistrar attribute(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RouteRegistrar

at line 113
static RouteRegistrar whereAlpha(array|string $parameters)

No description

Parameters

array|string $parameters

Return Value

RouteRegistrar

at line 113
static RouteRegistrar whereAlphaNumeric(array|string $parameters)

No description

Parameters

array|string $parameters

Return Value

RouteRegistrar

at line 113
static RouteRegistrar whereNumber(array|string $parameters)

No description

Parameters

array|string $parameters

Return Value

RouteRegistrar

at line 113
static RouteRegistrar whereUlid(array|string $parameters)

No description

Parameters

array|string $parameters

Return Value

RouteRegistrar

at line 113
static RouteRegistrar whereUuid(array|string $parameters)

No description

Parameters

array|string $parameters

Return Value

RouteRegistrar

at line 113
static RouteRegistrar whereIn(array|string $parameters, array $values)

No description

Parameters

array|string $parameters
array $values

Return Value

RouteRegistrar

at line 113
static RouteRegistrar as(string $value)

No description

Parameters

string $value

Return Value

RouteRegistrar

at line 113
static RouteRegistrar can(UnitEnum|string $ability, array|string $models = '[]')

No description

Parameters

UnitEnum|string $ability
array|string $models

Return Value

RouteRegistrar

at line 113
static RouteRegistrar controller(string $controller)

No description

Parameters

string $controller

Return Value

RouteRegistrar

at line 113
static RouteRegistrar domain(BackedEnum|string $value)

No description

Parameters

BackedEnum|string $value

Return Value

RouteRegistrar

at line 113
static RouteRegistrar middleware(null|array|string $middleware)

No description

Parameters

null|array|string $middleware

Return Value

RouteRegistrar

at line 113
static RouteRegistrar missing(Closure $missing)

No description

Parameters

Closure $missing

Return Value

RouteRegistrar

at line 113
static RouteRegistrar name(BackedEnum|string $value)

No description

Parameters

BackedEnum|string $value

Return Value

RouteRegistrar

at line 113
static RouteRegistrar namespace(null|string $value)

No description

Parameters

null|string $value

Return Value

RouteRegistrar

at line 113
static RouteRegistrar prefix(string $prefix)

No description

Parameters

string $prefix

Return Value

RouteRegistrar

at line 113
static RouteRegistrar scopeBindings()

No description

Return Value

RouteRegistrar

at line 113
static RouteRegistrar where(array $where)

No description

Parameters

array $where

Return Value

RouteRegistrar

at line 113
static RouteRegistrar withoutMiddleware(array|string $middleware)

No description

Parameters

array|string $middleware

Return Value

RouteRegistrar

at line 113
static RouteRegistrar withoutScopedBindings()

No description

Return Value

RouteRegistrar