In this tutorial you will learn about the Laravel Clear App Cache and its application with practical example.
Laravel Clear App Cache
In this Laravel Clear App Cache tutorial, I’ll show you how to clear app cache in laravel application. You’ll learn to clear app cache using artisan command as well as learn to clear laravel app cache on shared host from browser.
Clear App Cache Using Artisan Command
To clear laravel application cache use the php artisan cache:clear artisan command as given below :
1 |
php artisan cache:clear |
Clear App Cache On Shared Host
Most of the times in shared hosting servers we don’t have SSH access to the server. In that case, to clear laravel application cache we have define a route in our application’s routes/web.php file that invoke the laravel clear application cache command. This way we can clear application cache by accessing specific routes in the browser.
1 2 3 4 |
Route::get('/clear-cache', function() { $exitCode = Artisan::call('cache:clear'); return 'Application cache cleared'; }); |