当我 dump( Auth::user());
那给我看
User {#220 ▼
#attributes: array:10 [▼
"id" => "8"
"name" => "Vitaliy"
"email" => "dsadsa@i.ua"
"password" => "=)"
"remember_token" => null
"created_at" => "2017-10-19 13:11:21"
"updated_at" => "2017-10-19 13:11:21"
"phone" => "412412412"
"city" => "Dnipro"
"district" => "Leneinskiy"
]
#original: array:10 [▶]
....
}
在 protected 属性(property)中,我们看到了来自用户表的信息
我如何获得
#attributes
?或者请说我如何获取有关已登录用户的所有信息。
最佳答案
Auth::user()->name
Auth::user()->email
等等...
关于authentication - Laravel Auth::user() 获取属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46831749/