Laravel Eloquent ORM returnig stdClass instead of actual Model

喜欢而已 提交于 2019-12-25 04:19:40

问题


I'm doing

$mymodel = MyModel::where( 'url', $domain )->first();

and this was returning a MyModel object and now, somehow, it is returning a stdClass.

What's happening? Is it some update on the laravel? Have I changed something?

Thanks


回答1:


Found the problem. I did updated the laravel today and it was updating to a dev version. By being dev it could have bugs and it did. I just rollback to version "4.1.22" and it's working fine.




回答2:


I ran into the exact same issue yesterday. But just updated again and it seems to have been fixed.



来源:https://stackoverflow.com/questions/22105148/laravel-eloquent-orm-returnig-stdclass-instead-of-actual-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!