1
我是Laravel/Lumen和ORM的新人。 我已經得到了數據庫上此操作:更新後的雄辯retrive updated_at
$items = Item::where('id', $this->id)
->where('is_shown', 1);
->update([
'is_shown' => 0,
]);
我怎麼可以檢索更新操作後updated_at
列值,無需額外的查詢?
@mihai後()調用$項目是行數更新,而不是一個對象。我得到:'ErrorException:試圖獲取非對象的屬性' – user3396065
更好和正確的方法來解決這個問題可以在這裏找到https://stackoverflow.com/questions/41625247/laravel-get-record-id-from -update-query你也可以在這裏查看https://stackoverflow.com/questions/43093965/return-collection-after-update –