Support the ongoing development of →
Laravel Requests
Last updated 2 years ago.

I am not sure what exactly are u asking but if you want to make routes for every entity of category, you can do easily something like category/{id} in routes so its than something like:

Route::get('/category/{id}', function () {
    return view('category@show');

It is explained in this video from 6th minute:

Hope this will help. Let me know.

Last updated 6 years ago.

I meant that i didn't declare "category" word in my routes. In this case was executed this route:

'<controller:\w+>/<id:\d+>' => '<controller>/view',

I suppose it would looks like:

Route::get('/{controller}/{id}', function () {
    return view('{controller}@show');
Last updated 6 years ago.

I havent tried that yet but I think it is possible in the same way as I mentioned with ID if laravel supports more vars in url. Did you try it?


Sign in to participate in this thread!


Your banner here too?

adobe adobe Joined 26 Aug 2016


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

Your logo here?

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

© 2024 - All rights reserved.