Can the laravel eloquent model register a service provider?
黄舟
黄舟 2017-05-16 16:47:01
0
1
302

As shown in the picture, I registered the User model in the service, but when using it, the data retrieved is an empty model.
Can the eloquent model register a service provider? Is there any solution?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
巴扎黑

Looking at your code, it seems that you want to get the model of the currently logged in user. You cannot directly use the Auth facade to get the model of the currently logged in user

Auth::user()

Your code seems to have no problem at first glance, so I haven’t studied it in detail. Please check first to see if you are not logged in

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!