teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

補足

2019/04/03 18:02

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -1,7 +1,7 @@
1
1
  - `Illuminate\Contracts\Auth\Guard`
2
2
  - `Illuminate\Contracts\Auth\Factory`
3
3
 
4
- `Guard` か `Factory` をDIするのが正攻法だと思います。
4
+ `Guard` か `Factory` をDIするのが正攻法だと思います。`Guard` がデフォルト認証方法に設定されているもの(例えば `SessionGuard`),`Factory` が `AuthManager` に対応します。
5
5
 
6
6
  ```php
7
7
  class SomePlainOldPhpLogic

1

リンク

2019/04/03 18:02

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -18,4 +18,8 @@
18
18
  return $this->guard->user();
19
19
  }
20
20
  }
21
- ```
21
+ ```
22
+
23
+ コンテナの利用方法については
24
+ [【Laravel】サービスコンテナ・サービスプロバイダ・ファサード・契約に関する補足資料 - Qiita](https://qiita.com/mpyw/items/8b6f4666bfc98ff544dd)
25
+ をご覧ください