Route::bind('user', function($value, $route)
{
return User::where('XXX_ID', $value)->firstOrFail();
});
Then you'd probably define protected $primaryKey
on the model, what means, that route model binding will work with that field instead.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community