2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

★備忘録 Laravel Guardを使用しての認証カスタム

Posted at

Laravel8 でのマルチ認証機能(toC toB)作成にあたり、
Guardを用いての開発が簡単だった

Auth::guard();

上記メソッドを呼び出すだけで、通常のusersテーブルを使用しての
認証処理が実装可能で

Auth::guard('admin');

上記の様に引数を与えると
config/auth.phpの'guards'オブジェクトに追記した
値を読んで自動的にテーブルを切り替えてくれる

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?