Hi Dev,
Here, i will let you know how to clear cache in laravel 6. i will show you artisan command for clear cache of views, clear cache of config, clear cache of route in laravel 6 application.
You can just see bellow artisan command list for clearing cache in php laravel 6 application.
Sometime we need to cache clear when you change in configuration file or any thing change on view file after long time. so bellow command will help you to clear cache in laravel 6.
I want to share my experience and solution. when i was working on my laravel e
commerce website with gitlab. I was fetching one issue suddenly my view cache with error during development. i did try lot to refresh and something other but i can't see any more change in my view, but at last I did resolve my problem using laravel command so, let's see i added several command for clear cache from view, route, confir etc.
Clear Cache:
php artisan cache:clear
Clear Route Cache:
php artisan route:cache
Clear View Cache:
php artisan view:clear
Clear Config Cache:
php artisan config:cache
You can also clear cache without command using route. so you can create route as like bellow:
Route::get('/clear-cache-all', function() {
Artisan::call('cache:clear');
dd("Cache Clear All");
});
I hope it can help you...
Do you like below Tutorials ?
- Laravel 5.6 - Collection could not be converted to int
- Laravel - How to generate secure https URL from route?
- Laravel - Vue JS File Upload Example
- How to get last 7 days data in Laravel?
- Laravel Validation required if other field empty example
- Laravel Eloquent - When Case Statement in Select Query Example
- Laravel 7.x and 6.x Passing Variable to Javascript Example
- How to pass PHP variables in JavaScript or jQuery?