composer cache clear code example

Example 1: laravel artisan clear cache

//Updated Dec 2020
//laravel artisan clear cache 
php artisan view:clear 
php artisan cache:clear
php artisan route:clear
php artisan config:clear

Example 2: clear composer cache

composer clearcache
//Then autoload composer
composer dump-autoload

Example 3: composer remove cache

composer clearcache

#You can also use 

composer clear-cache

#which is an alias for clearcache.

Example 4: composer clear cache

$ composer clearcache

Example 5: clear cache without using composer in laravel 8

Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    // return what you want
});

Tags:

Html Example