Open alexanderthegreat96 opened 2 years ago
Hi @alexanderthegreat96 , You talking about Route grouping? If you are, did you check this documentation?
Nope. You know how you use groups to define prefixes. How about using Controller groups.
Just like laravel does it. So when you specify the group , how about specifying a controller for the group without having to declare it in each controller method.
Like so
$route->group('group',function() { $route->get('list','listMethodWithingMyController') }, 'MyController::classs');
or
$route->controller(MyController::class)->group('my-group',function() { $route->get('list','listMethodWithingMyController') })
Understand now?
Okay. For now, the Package no support such a usage like that but we can add this feature in next releases. I'll add it to my notes to implement it as soon as possible.
Thank you. I really appreciate it.
Okay. For now, the Package no support such a usage like that but we can add this feature in next releases. I'll add it to my notes to implement it as soon as possible.
There is a rational suggestion, what I sent you by mail with the processing of an array of routes, then there you can specify the controller for the group. And process a group with one controller and with different methods. Within the current version.
Is to possible to use controller groups. As Laravel does.
Defining controller + group in the same spot and then applying all the routes to the parent controller?