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? 
            Asked
            
        
        
            Active
            
        
            Viewed 3e+01k times
        
    202
            
            
         
    
    
        Karl Hill
        
- 12,937
- 5
- 58
- 95
 
    
    
        Naing Lin Aung
        
- 3,373
- 4
- 31
- 48
- 
                    23just to point out though , `php artisan dump-autoload` is not included in L5 – Jimmy Obonyo Abor Mar 24 '16 at 21:07
- 
                    I got this message after running dump-autoload in console Class App\Http\Middleware\AdminRedirectIfAuthenticated located in ./app/Http/Middleware/AdminRedirectifAuthenticated.php does not comply with psr-4 autoloading standard. Skipping. – mchomvu Apr 02 '22 at 09:32
2 Answers
180
            Laravel's Autoload is a bit different:
- It will in fact use - Composerfor some- stuff
- It will call - Composerwith 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-autoloadthem, one by one.
 
    
    
        Rakesh kumar Oad
        
- 1,332
- 1
- 15
- 24
 
    
    
        Antonio Carlos Ribeiro
        
- 86,191
- 22
- 213
- 204
- 
                    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. – woens May 22 '14 at 21:40
- 
                    
96
            
            
        php artisan dump-autoload was deprecated on Laravel 5, so you need to use composer dump-autoload
 
    
    
        Lucas Bustamante
        
- 15,821
- 7
- 92
- 86
- 
                    This is correct. For more information: https://laravel.com/docs/5.8/seeding#running-seeders – Brad Ahrens Aug 28 '19 at 11:09