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