laravel-routing
Installation
SKILL.md
Laravel routing
1. Route definition syntax
Use the invokable controller form (no second array element, no @method):
Route::get('articles', ListArticlesController::class)
->can('viewAny', Article::class);
Never call ->name() on your own routes. Naming is reserved for Fortify/framework routes that you don't own.
2. URL paths and parameters
- URL paths use kebab-case:
/error-occurrences,/open-source,/my-account. Never camelCase or snake_case in the URL. - Model-binding parameters take the singular model name (
{article},{comment}) — they resolve viaHasIdentifier(see §4). - Non-model parameters use camelCase:
{userId},{invoiceNumber}. Reserve these for the rare case where you can't use implicit binding.