RouteEntry class final

A registered route with fluent configuration (BLUEPRINT_V2 §7.3.2).

Constructors

RouteEntry({required List<String> methods, required String path, required Handler handler, List<Object> middleware = const <Object>[], String namePrefix = '', Map<String, RegExp> wheres = const <String, RegExp>{}})

Properties

actionName → String?
The controller action this route stands for (action), such as PostController@store (Laravel's route action; used by daragic).
no setter
bodyLimitBytes → int?
Per-route body limit in bytes (overrides BodyLimitsMiddleware).
no setter
constraints → Map<String, RegExp>
Parameter constraints (where).
no setter
declaredResponse → RouteResponse?
The declared response (returns).
no setter
declaredRules → Map<String, Object>?
Inline validation rules of this route (rules).
no setter
defaultValues → Map<String, Object?>
Default values for optional parameters.
no setter
formRequest → FormRequest?
The form request validating this route (validates).
no setter
handler → Handler
The handler.
final
hashCode → int
The hash code for this object.
no setterinherited
isFallback → bool
Whether this is the fallback route.
no setter
isWebSocket → bool
Whether this is a WebSocket endpoint (Router.ws).
no setter
methods → List<String>
Upper-cased HTTP methods served by this route.
final
middlewareEntries → List<Object>
Middleware entries as registered (instances or aliases).
no setter
optionalParameterNames → List<String>
Names of the optional parameters.
no setter
parameterNames → List<String>
Parameter names in order of appearance (optional markers stripped).
no setter
path → String
Normalized path (/api/users/{id}), optional markers preserved.
final
resolvedMiddleware → List<Middleware>
Middleware resolved at compile time.
no setter
routeName → String?
The route name (including any group prefix), if set.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
summaryText → String?
Short description (OpenAPI summary).
no setter
tagList → List<String>
Tags (OpenAPI tags).
no setter
timeoutDuration → Duration?
Per-route handler timeout (overrides the server default).
no setter

Methods

action(String action) → RouteEntry
Names the controller action this route stands for (PostController@store), as Laravel's route action does.
bodyLimit(int bytes) → RouteEntry
Sets the maximum body size accepted by this route.
defaults(Map<String, Object?> values) → RouteEntry
Default values for optional parameters that were not supplied.
documentedRules() → Map<String, Object>?
The rules describing this route's input: the inline rules, or those of the validates form request evaluated against an empty request (for documentation; null when none are declared or the form request's rules need a real request).
markFallback() → void
Marks this route as the fallback. Called by Router.fallback.
markWebSocket() → void
Marks this route as a WebSocket endpoint. Called by Router.ws.
matchesConstraints(Map<String, String> params, [Map<String, RegExp> globalPatterns = const <String, RegExp>{}]) → bool
Whether every captured parameter satisfies this route's constraints (and the router-wide globalPatterns for unconstrained parameters).
middleware(List<Object> entries) → RouteEntry
Appends route middleware (instances, aliases or groups).
name(String name) → RouteEntry
Assigns a name (prefixed by the enclosing group name prefix).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveMiddleware(MiddlewareRegistry registry) → void
Resolves aliases into instances. Called by Router.compile.
returns(Map<String, Object?> schema, {String? name, ResponseShape shape = .item, int? status}) → RouteEntry
Documents the response: schema is the JSON Schema of one item (for example one resource's toArray), shape says how it is returned ({"data": item}, a collection or one of Laravel's paginators) and name registers it under components/schemas.
rules(Map<String, Object> rules) → RouteEntry
Like validates with inline rules (request.validate(rules)).
summary(String text) → RouteEntry
OpenAPI metadata: short summary.
tags(List<String> tags) → RouteEntry
OpenAPI metadata: tags.
timeout(Duration duration) → RouteEntry
Sets a handler timeout; the kernel answers 503 when exceeded.
toString() → String
A string representation of this object.
override
validates(FormRequest request) → RouteEntry
Validates every request with request before the handler runs (after the route middleware), like a type-hinted FormRequest in Laravel: authorize() false answers 403, invalid input 422. The handler reads the result with request.validated(). The rules also document the route (dartisan openapi:generate, generated clients).
where(String param, Object pattern) → RouteEntry
Constrains param to pattern (anchored automatically).
whereAlpha(String param) → RouteEntry
whereAlphaNumeric(String param) → RouteEntry
whereIn(String param, List<String> values) → RouteEntry
Constrains param to one of values.
whereNumber(String param) → RouteEntry
whereUlid(String param) → RouteEntry
whereUuid(String param) → RouteEntry
withoutMiddleware<T extends Middleware>() → RouteEntry
Removes middleware of type T from this route.

Operators

operator ==(Object other) → bool
The equality operator.
inherited