Run artisan commands on shared hosting server (Laravel)
+ TODO delete logs shared hosting
1. Open the web.php file which is in the “route” folder of your project and paste the below code.
//Clear configurations:
Route::get(‘/config-clear’, function() {
$status = Artisan::call(‘config:clear’);
return ‘<h1>Configurations cleared</h1>’;
});
//Clear cache:
Route::get(‘/cache-clear’, function() {
$status = Artisan::call(‘cache:clear’);
return ‘<h1>Cache cleared</h1>’;
});
//Clear configuration cache:
Route::get(‘/config-cache’, function() {
$status = Artisan::call(‘config:Cache’);
return ‘<h1>Configurations cache cleared</h1>’;
https://blog.webnersolutions.com/run-artisan-commands-on-shared-hosting-server-laravel/