jeroenvanrensen's avatar

What happens between a service provider and the routes file?

Hi everyone,

I'm creating a Laravel package and I have a strange bug.

If I call dd('Test') in my service provider, I see it on the page.

But if I call dd('Test') in my routes file, the error shows (so it doesn't reach the call).

I'm loading/registering the routes in my service provider.

So, the problem should be somewhere between the service provider and my routes file.

So, what happens between the $this->loadRoutesFrom() call and the routes file that can throw this error?

Thank you! Jeroen

0 likes
4 replies
s4muel's avatar
s4muel
Best Answer
Level 50

are your routes cached, by any chance? if so, your routes file is not called.

try clearing the routes cache

php artisan route:clear
tykus's avatar

the error shows

What error shows?

jeroenvanrensen's avatar

I changed a controller path, but it didn't reflect in my route file. So it tried to load the old controller

Please or to participate in this conversation.