xxxxxxxxxx
//just create below route and visit it.
use Illuminate\Support\Facades\Artisan;
Route::get('/clear-cache', function () {
Artisan::call('route:cache');
Artisan::call('config:cache');
Artisan::call('cache:clear');
Artisan::call('view:clear');
return 'clear';
});
xxxxxxxxxx
//Updated Dec 2020
//laravel artisan clear cache
php artisan view:clear
php artisan cache:clear
php artisan route:clear
php artisan config:clear
xxxxxxxxxx
php artisan optimize:clear
//This clears all laravel caches for views,application, route,configuration
// and complied services and packages
xxxxxxxxxx
//Borra la cache de laravel: Solo copia y pega.
php artisan config:cache &&
php artisan route:clear &&
php artisan view:clear &&
php artisan config:clear &&
php artisan cache:clear &&
php artisan clear-compiled
xxxxxxxxxx
php artisan view:clear
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan optimize
xxxxxxxxxx
php artisan view:clear
php artisan config:clear
php artisan route:clear
php artisan cache:clear
php artisan clear-compiled
xxxxxxxxxx
// Keep life simple :)
sail artisan optimize:clear
or
php artisan optimize:clear
// Output: Cached events cleared!
"
Compiled views cleared!
Application cache cleared!
Route cache cleared!
Configuration cache cleared!
Compiled services and packages files removed!
Caches cleared successfully!
"
xxxxxxxxxx
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan config:clear
xxxxxxxxxx
Route::get('/clear', function () {
\Artisan::call('cache:clear');
\Artisan::call('view:clear');
\Artisan::call('route:clear');
\Artisan::call('clear-compiled');
\Artisan::call('config:cache');
dd("Cache is cleared");
});