Laravel Eloquent ORM returnig stdClass instead of

2019-09-19 09:28发布

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

2条回答
劫难
2楼-- · 2019-09-19 09:56

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

查看更多
可以哭但决不认输i
3楼-- · 2019-09-19 10:20

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.

查看更多
登录 后发表回答