You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been dabbling with the framework for the past few days on my free time at work and I really like the project!
One thing that bothered me while building a small POC project was defining a new invokable class for each one of my endpoints, on large projects I think this is a nice pattern, but for simpler applications I enjoy grouping endpoints on the same controller class, for example: FooController::index, FooController::create, FooController::update, etc, right now this is not possible.
Do you guys think this could be a good feature? The syntax I have in mind is basically what everyone has seen on other PHP frameworks, something like:
The Symfony approach with attributes would be even cooler, but I think that would require a lot more work.
I was able to make the following test pass without messing too much with the code, if it sounds like a good idea I can send a draft PR and we can go on from there. I only had to change RouteHandler::map to check if $handler is an array and also had to touch Container::callable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, everyone!
I've been dabbling with the framework for the past few days on my free time at work and I really like the project!
One thing that bothered me while building a small POC project was defining a new invokable class for each one of my endpoints, on large projects I think this is a nice pattern, but for simpler applications I enjoy grouping endpoints on the same controller class, for example:
FooController::index
,FooController::create
,FooController::update
, etc, right now this is not possible.Do you guys think this could be a good feature? The syntax I have in mind is basically what everyone has seen on other PHP frameworks, something like:
The Symfony approach with attributes would be even cooler, but I think that would require a lot more work.
I was able to make the following test pass without messing too much with the code, if it sounds like a good idea I can send a draft PR and we can go on from there. I only had to change
RouteHandler::map
to check if$handler
is an array and also had to touchContainer::callable
.Let me know what you guys think :)
Beta Was this translation helpful? Give feedback.
All reactions