Laravel and the compiled.php file

Posted in Code, Laravel, PHP on Dec 18, 2014

To be more efficient, Laravel can optimize its files, by putting certain classes in `bootstrap/compiled.php` to allow the framework to load all of them in one go. The standard composer.json includes a call to `php artisan clear-compiled` as a post-update and post-install command, which has the effect of removing this file. Unfortunately if the updated files are incompatible with the old ones that were just replaced, this can lead to the following error: