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.

Related concepts

Explicit Binding: Customizing The Resolution Logic — Structure map

Clickable & Draggable!

Explicit Binding: Customizing The Resolution Logic — Related pages: