In Resource Controllers, in routes/web.php
you can specify ->names()
parameter, so the URL prefix and the route name prefix may be different.
This will generate URLs like /p
, /p/{id}
, /p/{id}/edit
etc. But you would call them:
- route('products.index)
- route('products.create)
- etc
1Route::resource('p', \App\Http\Controllers\ProductController::class)->names('products');