In this tutorial you will learn about the Laravel Clear config cache and its application with practical example.
Laravel Clear Config Cache
In this Laravel Clear config Cache tutorial, I’ll show you how to clear config cache in laravel application. You’ll learn to clear config cache using artisan command as well as learn to clear laravel config cache on shared host from browser.
Clear Config Cache Using Artisan Command
To clear config cache in laravel use the php artisan config:cache artisan command as given below :
1 |
php artisan config:cache |
Laravel Clear Config 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 config cache we have define a route in our application’s routes/web.php file that invoke the laravel clear config cache command. This way we can clear config cache by accessing specific routes in the browser.
1 2 3 4 |
Route::get('/config-cache', function() { $exitCode = Artisan::call('config:cache'); return 'Config cache cleared'; }); |