laravel clear cache on server code example
Example 1: laravel clear cache
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
Example 2: clear all cache in laravel
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache
Example 3: clear cache without using composer in laravel 8
Route::get('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
// return what you want
});
Example 4: laravel controller cache clear
php artisan cache:clear
Example 5: clear cache in laravel without artisan
Route::get('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
return 'Application cache cleared';
});