Mar 27, 2019
0
Level 1
API Resource Non-Related Model
Hi, I know how to make Laravel API resource if relationship is involved. But how about if they are not related?
$inventories = Inventory::all();
$categories = Category::all();
I want to merge them with keys but not using the put method of collection as it returns array. I want object.
Please or to participate in this conversation.