Can the laravel eloquent model register a service provider?
黄舟2017-05-16 16:47:01
0
1
364
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?
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
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