
ショコラ
Laravel ユーザー情報を取得するには?
\Authでもアクセスできます。

もっさん先輩
名前空間 Illuminate\Support\Facades\Auth をインポートする。
use Illuminate\Support\Facades\Auth;
認証しているユーザーを取得する。
Auth::user()
認証しているユーザーの名前を取得する。
Auth::user()-name
認証しているユーザーの ID を取得する。
Auth::id()
認証済みか判定する。
Auth::check()
ガードを指定してユーザーを取得する。
Auth::guard('member')->user()
Auth::guard('member')->user()