xxxxxxxxxx
Route::get('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
// return what you want
});
xxxxxxxxxx
composer clearcache
#You can also use
composer clear-cache
#which is an alias for clearcache.
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
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
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");
});
xxxxxxxxxx
$ php artisan view:clear
$ php artisan config:clear
$ php artisan route:clear
$ php artisan cache:clear
$ php artisan clear-compiled