Support the ongoing development of Laravel.io →
Configuration Eloquent

I'm experiencing an issue where Binding a model to a route works in routes.php when using

Route::model('user', 'App\User');

but fails in RouteServiceProvider.php when updating the boot function with

$router->model('user', 'App\User');

From the 5.0 documentation, updating the boot function seems to be the way to go, but in 4.2 documentation using the Route facade seems to be the way to go. Is this a possible bug in 5.0?

Or is there another explanation for the observed difference?

Last updated 3 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.

© 2025 Laravel.io - All rights reserved.