Skip to content

Document route() throw behavior and hasRoute predicate#152

Open
rubenvanassche wants to merge 2 commits into
mainfrom
docs/route-throws-and-exists
Open

Document route() throw behavior and hasRoute predicate#152
rubenvanassche wants to merge 2 commits into
mainfrom
docs/route-throws-and-exists

Conversation

@rubenvanassche

Copy link
Copy Markdown
Member

Summary

Adds a "Handling unknown routes" section to the Laravel routes docs covering:

  • The generated route() helper now throws on unknown route names (matching Laravel's server-side RouteNotFoundException behavior).
  • The new hasRoute(name): name is keyof RouteParameters type predicate exported alongside route(), mirroring Laravel's Route::has().
  • Example usage for dynamic-name callers (locale-aware routing, runtime-composed keys) showing how the predicate narrows the type.

Documents the behavior introduced in spatie/laravel-typescript-transformer#85.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant