sohelamin's avatar

Lumen Resource Routing

Hi,

I'm trying to make resource routing as laravel do but seems in lumen does not have any option for that. For this case, I just created a method look like this https://gist.github.com/sohelamin/a85329700f1ecae1b490#file-lumen-resource-route-php

Could you help me how can I put the function inside the application class without changing any core file? Should I need to create service provider or anything else? Please help me out.

Thanks Sohel Amin

0 likes
4 replies
bobbybouwmann's avatar

What is the point of recreating stuff that's left out of Lumen? There is a reason it's removed so it's faster! The idea of Lumen is to use minimal code and minimal files so your api/microservice stays fast! Adding these kind of methods back in the system might not be good idea. If you want these features from Laravel just use the Laravel framework..

Now for your code. The best way would be extending the current core files for routing.

1 like
sohelamin's avatar

Hi blackbird,

Thanks for your reply and I appreciate your thought.

Since, Lumen is created as micro framework and for api I think it can be allow to create rest-full routes within one route(resource). Thought, it is not my main concern, I just seeking how we can extend the lumen Application class or $app instance for some cases eg: if i like to use $app->resource() (method) instead of any filter or anything. And if you have any idea then please help me out to extend it or through given any materials.

Thanks a lot.

1 like

Please or to participate in this conversation.