Explicit Binding: Customizing The Resolution Logic
Public function boot()
{
parent::boot();
Route::bind('user', function ($value) {
return App\User::where('name', $value)->first() ?? abort(404);
});
} If you wish to use your own resolution logic, you may use the Route::bind method.
Semantic portal