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?
Composer dump-autoload It just regenerates the list of all classes that need to be included in the project (autoload_classmap. php). Ideal for when you have a new class inside your project.
composer dump-autoload. php artisan dump-autoload. It regenerates the list of all the classes that need to be included in the project (autoload_classmap. php). It will 'recompile' loads of files creating the huge bootstrap/compiled.php.
Auto-Loading allows you to load class files when they are needed without explicitly loading or including them. This gives you ease in running your application by loading those files automatically which are needed every time. Laravel is built to work with Composer.
Yes, manually removing all files of the autoloader in the vendor/composer/ folder should work. So, all vendor/composer/autoload_*.
Laravel's
Autoload
is a bit different:
It will in fact use Composer
for some stuff
It will call Composer
with the optimize flag
It will 'recompile
' loads of files creating the huge bootstrap/compiled.php
And also will find all of your Workbench packages and composer dump-autoload
them, one by one.
php artisan dump-autoload
was deprecated on Laravel 5, so you need to use composer dump-autoload
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