【发布时间】:2017-12-19 08:33:54
【问题描述】:
在我的控制器中
$all = \App\Product::where('campaign_id', $product->campaign_id)->get();
当我在模板中 DD 时
{{ dd($all)}}
我得到一个集合对象
Collection {#340 ▼
#items: array:1 [▼
0 => Product {#341 ▼
#connection: "mysql"
#table: null
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#attributes: array:10 [▶]
#original: array:10 [▶]
#casts: []
#dates: []
#dateFormat: null
#appends: []
#events: []
#observables: []
#relations: []
#touches: []
+timestamps: true
#hidden: []
#visible: []
#fillable: []
#guarded: array:1 [▶]
}
]
}
如何查看返回的基本数组?
【问题讨论】:
标签: arrays debugging laravel-5 collections