run command using route in laravel code example
Example: execute artisan command from route
Route::get('clear_cache', function () {
\Artisan::call('cache:clear');
dd("Cache is cleared");
});
Route::get('clear_cache', function () {
\Artisan::call('cache:clear');
dd("Cache is cleared");
});