Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
无法通过修补程序访问数据库字段
$job::find(2)->despatches->qty
不工作
$job::find(2)->despatches
作品
但我需要访问发件的数量字段
这可以通过修补程序实现吗?
由于$job::find(2)->despatches返回一个集合,您必须使用pluck():
pluck()
$job::find(2)->despatches->pluck('qty')