Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0
Route::bind('user', function($value, $route)
{
    return User::where('XXX_ID', $value)->firstOrFail();
});
Last updated 2 years ago.
0

Then you'd probably define protected $primaryKey on the model, what means, that route model binding will work with that field instead.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.