In Laravel php artisan cache:clear command is used to clear cache.
It will remove all the cache associated with the connection to the database.
Usage:
php artisan cache:clear
Further, on shared hosting, you can use below code in your routes/web.php file to remove your database cache.
Route::get('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
return "Cache is cleared";
});
To clear config cache of your Laravel application run below command on terminal.
php artisan config:cache
To clear route cache of your Laravel application run below command on terminal.
This post is submitted by one of our members. You may submit a new post here.
Laravel interview Questions © 2019 - Designed by PSD to HTML