Clear Application Cache
To clear your Laravel application cache you can run the command below.
php artisan cache:clear
Clear Configuration Cache
To clean your environment (.env) configuration cache, run the command below.
php artisan config:clear
Clear Route Cache
To clear all of your Laravel route cache you can run the command below.
php artisan route:clear
Clear Compiled Views Cache
To clear the compiled views cache that Laravel has rendered, you can run the command below.
php artisan view:clear
Extra: Clear Cache from Browser
Sometimes you might have no access (SSH) to the terminal in production. In this case, you can define a new web route to clear the cache.
# /routes/web.php <?php Route::get('/clear-all-cache', function () { Artisan::call('cache:clear'); Artisan::call('config:clear'); Artisan::call('route:clear'); Artisan::call('view:clear'); return 'The application cache has been cleared'; });
Leave a reply