The documented way to generate bootstrap/compiled.php is to run the artisan command: artisan optimize
The problem with artisan optimize is that it runs composer dump-autoload --optimize which flattens out every PSR-0 loading class in composer_classmap.php file. If you are using a library like Zend with PSR-0 autoloading, this classmap file goes beyond 3000 lines. Which is very un-optimal to load on every web request, so I do not want to do that.
How do I simply generate the compiled.php file without populating the composer classmap file?
Looking at the code, it seems that there is no way to do that. But I changed the code to provide an option and made a pull request: https://github.com/laravel/framework/pull/3708.
EDIT
Pull request merged. Now you can run:
php artisan optimize --psr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With