jerauf's avatar

[05-Jul-2017 23:46:09 America/Los_Angeles] PHP Fatal error: Class 'Route' not found in [My Path]/routes/Forwards/forwarded.php on line 2

I keep getting this error at the top of my screen and can't figure out where the problem lies. The mention of Los Angeles is puzzling because my app time zone is set to New York.

This references an outside file that's not part of my routes file. I tried a dump auto-load along with clearing the cache. It gives me the same error in terminal.

Can anyone help? All of this appears at the top of every screen in my app.

0 likes
6 replies
jerauf's avatar

Just routes. It starts with <?php. I checked the Laravel docs and they're just normal routes.

Snapey's avatar

but they cannot be processed because Laravel cannot resolve Route. this is what the error is telling you

jerauf's avatar

Exactly. That's what I don't understand.

Cronix's avatar

how are you "referencing" the file? include it in your existing laravel routes file?

jerauf's avatar

In web.php, I'm referencing like this.

foreach (File::allFiles(DIR.'/Forwards') as $partial) { require_once $partial->getPathname(); }

This error has randomly showed up. The site was fine on the 4th. Then yesterday, this happened.

Please or to participate in this conversation.