Generating Optimized Composer Autoload Files For Laravel

Whenever you edit your composer.json file, a good practice is to generate new autoload files. You can do this easily from your terminal window by running the following command:

composer dump­-autoload

To generate optimized files you have 2 options. The first option is to included the ­-o flag as follows:

composer dump­autoload ­-o

The second and easiest way is to use Laravel's dump­-autoload command:

php artisan dump­autoload