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