0
1

[Laravel] テスト時にユーザー情報が更新されない問題の対処法

Last updated at Posted at 2023-11-07

問題⚠️

テスト中は、認証済みユーザーの情報がキャッシュされるため、
最新のユーザー状態が反映されないことがある。

解決策✅

現在の認証済みユーザーをリフレッシュすることで、この問題を回避する。

Auth::user()->refresh();

0
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
0
1