when to route to controller or view laravel code example
Example: laravel route controller
use App\Http\Controllers\UserController;
Route::get('user/{id}', [UserController::class, 'show']);
use App\Http\Controllers\UserController;
Route::get('user/{id}', [UserController::class, 'show']);