Using Artisan Command
To clear the config using the artisan command, you can simply run "config:clear" from your terminal/command line.
php artisan config:clear
Clear Config Cache In Laravel Programmatically
To clear the config cache programmatically you can make use of that Artisan facade. For the code example below you can define a new route called "/clear-config-cache" and this will clear all the configurations when the URL path is accessed.
<?php Route::get('/clear-config-cache', function () { Artisan::call('config:clear'); });
Leave a reply