call route via artisan command 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");
});