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

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: https://laracasts.com/series/laravel-from-scratch-2017/episodes/11

Hope this will help. Let me know.

Last updated 6 years ago.
0

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.
0

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?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

adobe adobe Joined 26 Aug 2016

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.

© 2024 Laravel.io - All rights reserved.