K
K
kirshevs2020-08-19 20:13:26
Laravel
kirshevs, 2020-08-19 20:13:26

Is it possible to use similar routes without unification in Laravel?

I use the Laravel + Vue bundle, I form the routes in the components using the library (ziggy-js)
I want to make the following url structure domain.com/category domain.com/tag for
the web.php example:

Route::get('{category}', ['as' => 'category', 'uses' => '\App\Http\Controllers\[email protected]']);
Route::get('{tag}', ['as' => 'tag', 'uses' => '\App\Http\Controllers\[email protected]']);


I perfectly understand that with such routes, tags will be "intercepted" by categories, but doing something like
domain.com/categories/category and domain.com/tags/tag seems like overkill to me

Honestly, I thought that they could help with this named routes, for this I separately figured out how to call routes by name in vue components, but the result is the same

Is there really no other option but to unify by cluttering up the url?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question