'PhpStorm Built-In Server: Class 'Route' not found (Laravel)

I am running PhpStorm's built-in server locally on port 8888. I also checked "use router script" in the Run/Debug Configurations and pointed it to my routes.php.

But when I run localhost:8888 in the browser, I get an error of

Class 'Route' not found in .../routes.php on line 23.

Any advise?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source