本文介紹了Laravel Eloquent ORM 返回 stdClass 而不是實(shí)際模型的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我在做
$mymodel = MyModel::where( 'url', $domain )->first();
這是返回一個(gè) MyModel 對(duì)象,現(xiàn)在不知何故,它正在返回一個(gè) stdClass.
and this was returning a MyModel object and now, somehow, it is returning a stdClass.
發(fā)生了什么事?Laravel 有什么更新嗎?我改變了什么嗎?
What's happening? Is it some update on the laravel? Have I changed something?
謝謝
推薦答案
發(fā)現(xiàn)問題.我今天確實(shí)更新了 laravel,它正在更新到開發(fā)版本.作為開發(fā)人員,它可能有錯(cuò)誤,而且確實(shí)如此.我只是回滾到版本4.1.22",它工作正常.
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.
這篇關(guān)于Laravel Eloquent ORM 返回 stdClass 而不是實(shí)際模型的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!