"8" "name" => "V-6ren">
gpt4 book ai didi

authentication - Laravel Auth::user() 获取属性

转载 作者:行者123 更新时间:2023-12-04 14:41:32 24 4
gpt4 key购买 nike

当我 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()->nameAuth::user()->email
等等...

关于authentication - Laravel Auth::user() 获取属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46831749/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com