-
-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Hey @mychidarko,
Do we currently have support for model-router binding similar to Laravel?
For example, something like this:
app()->get('/users/{user}', function (User $user) {
echo $user;
});
In Laravel, we can specify the binding rules for a given route parameter and define how it should be resolved. For instance:
public function bindParameterUser(): void
{
Route::bind('user', function ($value) {
return User::with('posts')
->orWhere('hash', $value)
->firstOrFail();
});
}
Metadata
Metadata
Assignees
Labels
No labels