Support the ongoing development of Laravel.io →
posted 7 months ago
Forms
Last updated by @nnngit 6 months ago.
0

Please share some code. There's very little here to start with. What is the code that you're using, what is happening and what do you expect to happen?

0

i seen in lara docs that there can be same name in route with get post verb for view also this adapts

0

Please share some code.

0
Route::get('view/{id}', '[email protected]')->name('post');
Route::delete('view/{id}', '[email protected]')->name('post');
Route::post('view/{id}', '[email protected]')->name('post');

does laravel takes same route name with diff verbs internally laravel takes care v can give like above

Last updated 7 months ago.
0

No, you'll need to use unique names for these. This is important when, for example, caching routes:

Route::get('view/{id}', '[email protected]')->name('post');
Route::delete('view/{id}', '[email protected]')->name('post.delete');
Route::post('view/{id}', '[email protected]')->name('post.create');

However, you can also just name one route and since it references the same url, it doesn't matter:

Route::get('view/{id}', '[email protected]')->name('post');
Route::delete('view/{id}', '[email protected]');
Route::post('view/{id}', '[email protected]');
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

sslaravel nnngit Joined 26 Mar 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.