现在,我正在像这样使用Eloquent:MobileAppUsers::where('store', '=', 'store_name')->first();
事实证明我不需要检查store_name
,因为整个表都在该商店的数据库内,所以我只想要一个记录将在那里(只有1)。
不更改任何其他逻辑,将等于MobileAppUsers::where('store', '=', 'store_name')->first();
(忽略store_name
)为:
MobileAppUsers::take(1)->get();
吗?
答案 0 :(得分:2)
您可以使用此
MobileAppUsers::first();
关于,希望对您有帮助