class
Route extends Facade (View source)
Properties
static protected Application|null
|
$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.
spy()
Convert the facade into a Mockery spy.
expects()
Initiate a mock expectation on the facade.
createMock()
Create a fresh mock instance for the given class.
static bool
isMock()
Determines whether a mock is set as the instance of the facade.
static void
swap(mixed $instance)
Hotswap the underlying instance behind the facade.
static bool
isFake()
Determines whether a "fake" has been set as the facade instance.
static mixed
__callStatic(string $method, array $args)
Handle dynamic, static calls to the object.
get(string $uri, array|string|callable|null $action = null)
No description
post(string $uri, array|string|callable|null $action = null)
No description
put(string $uri, array|string|callable|null $action = null)
No description
patch(string $uri, array|string|callable|null $action = null)
No description
delete(string $uri, array|string|callable|null $action = null)
No description
options(string $uri, array|string|callable|null $action = null)
No description
any(string $uri, array|string|callable|null $action = null)
No description
fallback(array|string|callable|null $action)
No description
redirect(string $uri, string $destination, int $status = 302)
No description
view(string $uri, string $view, array $data = [], int|array $status = 200, array $headers = [])
No description
match(array|string $methods, string $uri, array|string|callable|null $action = null)
No description
static void
resources(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
group(array $attributes, Closure|array|string $routes)
No description
addRoute(array|string $methods, string $uri, array|string|callable|null $action)
No description
newRoute(array|string $methods, string $uri, mixed $action)
No description
toResponse(
Request $request, mixed $response)
No description
static void
matched(string|callable $callback)
No description
static void
bind(string $key, string|callable $binder)
No description
static void
model(string $key, string $class, Closure|null $callback = null)
No description
static void
pattern(string $key, string $pattern)
No description
static void
patterns(array $patterns)
No description
static mixed
input(string $key, string|null $default = null)
No description
static bool
has(string|array $name)
No description
static bool
is(mixed $patterns)
No description
static bool
uses(array|string $patterns)
No description
static void
macro(string $name, object|callable $macro)
No description
static void
mixin(object $mixin, bool $replace = true)
No description
static mixed
macroCall(string $method, array $parameters)
No description
tap(callable|null $callback = null)
No description
attribute(string $key, mixed $value)
No description
whereAlpha(array|string $parameters)
No description
whereUlid(array|string $parameters)
No description
whereUuid(array|string $parameters)
No description
whereIn(array|string $parameters, array $values)
No description
as(string $value)
No description
can(UnitEnum|string $ability, array|string $models = [])
No description
domain(BackedEnum|string $value)
No description
middleware(array|string|null $middleware)
No description
name(BackedEnum|string $value)
No description
prefix(string $prefix)
No description
where(array $where)
No description
Details
Run a Closure when the facade has been resolved.
Convert the facade into a Mockery spy.
static MockInterface
partialMock()
Initiate a partial mock on the facade.
static Expectation
shouldReceive()
Initiate a mock expectation on the facade.
Initiate a mock expectation on the facade.
static protected MockInterface
createFreshMockInstance()
Create a fresh mock instance for the given class.
static protected MockInterface
createMock()
Create a fresh mock instance for the given class.
static protected bool
isMock()
Determines whether a mock is set as the instance of the facade.
static protected string|null
getMockableClass()
Get the mockable class for the bound instance.
static void
swap(mixed $instance)
Hotswap the underlying instance behind the facade.
Determines whether a "fake" has been set as the facade instance.
Get the root object behind the facade.
static protected string
getFacadeAccessor()
Get the registered name of the component.
static protected mixed
resolveFacadeInstance(string $name)
Resolve the facade root instance from the container.
static void
clearResolvedInstance(string $name)
Clear a resolved facade instance.
static void
clearResolvedInstances()
Clear all of the resolved instances.
Get the application default aliases.
Get the application instance behind the facade.
Set the application instance.
static mixed
__callStatic(string $method, array $args)
Handle dynamic, static calls to the object.
static Route
get(string $uri, array|string|callable|null $action = null)
static Route
post(string $uri, array|string|callable|null $action = null)
static Route
put(string $uri, array|string|callable|null $action = null)
static Route
patch(string $uri, array|string|callable|null $action = null)
static Route
delete(string $uri, array|string|callable|null $action = null)
static Route
options(string $uri, array|string|callable|null $action = null)
static Route
any(string $uri, array|string|callable|null $action = null)
static Route
fallback(array|string|callable|null $action)
static Route
redirect(string $uri, string $destination, int $status = 302)
static Route
permanentRedirect(string $uri, string $destination)
static Route
view(string $uri, string $view, array $data = [], int|array $status = 200, array $headers = [])
static Route
match(array|string $methods, string $uri, array|string|callable|null $action = null)
static void
resources(array $resources, array $options = [])
static void
apiResources(array $resources, array $options = [])
static void
singletons(array $singletons, array $options = [])
static void
apiSingletons(array $singletons, array $options = [])
static Router
group(array $attributes, Closure|array|string $routes)
static array
mergeWithLastGroup(array $new, bool $prependExistingPrefix = true)
static string
getLastGroupPrefix()
static Route
addRoute(array|string $methods, string $uri, array|string|callable|null $action)
static Route
newRoute(array|string $methods, string $uri, mixed $action)
static Response
respondWithRoute(string $name)
static Response
dispatchToRoute(Request $request)
static array
gatherRouteMiddleware(Route $route)
static array
resolveMiddleware(array $middleware, array $excluded = [])
static Response
prepareResponse(Request $request, mixed $response)
static Response
toResponse(Request $request, mixed $response)
static void
substituteImplicitBindings(Route $route)
static Router
substituteImplicitBindingsUsing(callable $callback)
static void
matched(string|callable $callback)
static array
getMiddleware()
static Router
aliasMiddleware(string $name, string $class)
static bool
hasMiddlewareGroup(string $name)
static array
getMiddlewareGroups()
static Router
middlewareGroup(string $name, array $middleware)
static Router
prependMiddlewareToGroup(string $group, string $middleware)
static Router
pushMiddlewareToGroup(string $group, string $middleware)
static Router
removeMiddlewareFromGroup(string $group, string $middleware)
static void
bind(string $key, string|callable $binder)
static void
model(string $key, string $class, Closure|null $callback = null)
static Closure|null
getBindingCallback(string $key)
static array
getPatterns()
static void
pattern(string $key, string $pattern)
static void
patterns(array $patterns)
static bool
hasGroupStack()
static array
getGroupStack()
static Route|null
getCurrentRoute()
static Route|null
current()
static bool
has(string|array $name)
static string|null
currentRouteName()
static bool
is(mixed $patterns)
static bool
currentRouteNamed(mixed $patterns)
static string|null
currentRouteAction()
static bool
uses(array|string $patterns)
static bool
currentRouteUses(string $action)
static void
singularResourceParameters(bool $singular = true)
static void
resourceParameters(array $parameters = [])
static array|null
resourceVerbs(array $verbs = [])
static void
setCompiledRoutes(array $routes)
static array
uniqueMiddleware(array $middleware)
static void
macro(string $name, object|callable $macro)
static void
mixin(object $mixin, bool $replace = true)
static bool
hasMacro(string $name)
static void
flushMacros()
static mixed
macroCall(string $method, array $parameters)
static Router
tap(callable|null $callback = null)
static RouteRegistrar
whereIn(array|string $parameters, array $values)
static RouteRegistrar
can(UnitEnum|string $ability, array|string $models = [])