masonite
masonite copied to clipboard
Route Model Binding
Is your feature request related to a problem?
It would be very useful to have Route Model Binding, similar to what Laravel has.
What do we currently have to do now?
Currently, you have to retrieve the model by hand.
Describe the solution you'd like
Something like this:
routes/web.py:
Route.get('users/{user}', 'UserController@show')
app/controllers/UserController.py:
from app.models.User import User
def show(self, user: User):
return user
Describe alternatives you've considered
No response
Would this be a breaking change ?
- [ ] Yes
Anything else ?
No response