input('id'); $detail = Special::query() ->select(['id', 'picture', 'picture_ad', 'updated_at', 'agent_product_id']) ->find($id); $detail->product = AgentProduct::query() ->whereIn('id', $detail->agent_product_id) ->select('id', 'sale', 'product_id', 'price', 'original_price') ->with('product:id,title,pictures') ->limit(6)->get(); unset($detail->agent_product_id); return $this->success($detail); } }