ログイン後のページ遷移(Breeze)

○Breezeを使用した場合ログイン後のページ遷移はapp/Providers/RouteServiceProvider.phpで変更できる。

例)

public const HOME = '/dashboard';
  ↓
public const HOME = '/club';"

 

○ログイン後、役割に応じでページ遷移を変更したい場合
例)
[web.php]
Route::get('/dashboard', function () {
    return view('dashboard');
})->middleware(['auth'])->name('dashboard');

  ↓

Route::get('/dashboard', [○○Controller::class, 'dashboard'])->middleware(['auth'])->name('dashboard');

 

のようにし、○○Controllerにdashboardメソッド定義し、if文で振り分け処理を書く。