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?
巴扎黑2017-05-16 16:49:01
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