Differences between “php artisan dump-autoload” and “composer dump-autoload

Following below some difference between “php artisan dump-autoload” and “composer dump-autoload”

Laravel’s Autoload is a bit different:

Composer dump-autoload

  1. PATH vendor/composer/autoload_classmap.php
  2. Composer dump-autoload won’t download a thing.
  3. It just regenerates the list of all classes that need to be included in the project (autoload_classmap.php).
  4. Ideal for when you have a new class inside your project.
  5. autoload_classmap.php also includes the providers in config/app.php

PHP artisan dump-autoload

    1. It will call the Composer with the optimize flag
    2. It will ‘recompile’ loads of files creating the huge bootstrap/compiled.php