how to define new router in laravel 8 code example
Example 1: laraval routing
use App\Http\Controllers\UserController;
use App\Models\User;
// Route definition...
Route::get('/users/{user}', [UserController::class, 'show']);
// Controller method definition...
public function show(User $user)
{
return view('user.profile', ['user' => $user]);
}
Example 2: laravel route
Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');