I am pretty new to Laravel 4 and Composer. While I do Laravel 4 tutorials, I couldn't understand the difference between those two commands; php artisan dump-autoload
and composer dump-autoload
What's the difference between them?
2 Answers
Laravel's
Autoload
is a bit different:
It will in fact use
Composer
for somestuff
It will call
Composer
with the optimizeflag
It will '
recompile
' loads of files creating the hugebootstrap/compiled.php
And also will find all of your Workbench packages and
composer dump-autoload
them, one by one.
-
17But you still need to run composer dump-autoload as well as artisan dump-autoload in order to get all autoloads right. Example: After a migrate:make, you need a composer dump-autoload in order to do a migrate:rollback. artisan dump-autoload does not work here.– woensCommented May 22, 2014 at 21:40
-
php artisan dump-autoload
was deprecated on Laravel 5, so you need to use composer dump-autoload
-
1This is correct. For more information: laravel.com/docs/5.8/seeding#running-seeders Commented Aug 28, 2019 at 11:09
php artisan dump-autoload
is not included in L5