This post is for those who are working on Laravel Lumen projects with Swagger UI which runs using the PHP built-in web server.
If you are using the DarkaOnline/SwaggerLume library to generate the Swagger UI, you will probably notice that the Swagger UI is empty. And if you inspect the front-end error in the Swagger UI web page, you will see that it will display the error:
In the screenshot, you will find errors such as,
The root cause of the error is due to running the built-in PHP web-server with the following command:
To resolve this issue, you will need to run the web server with the following command instead:
By specifying the document root as 'public/index.php' with the above command, laravel lumen is able to find the swagger UI assets.