PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | api/Resource/SubscriptionResource.php +4 -1 1.3.27 → 1.6.5 View file →
@@ -62,9 +62,11 @@
62 62
63 63 $sortCriteria = Arr::get($params, 'sort_criteria', []);
64 64 Sort::make()->apply($query, $sortCriteria);
65 65
66 - $with = ['customer'];
66 + // product is eager-loaded so the appended display_item_name accessor
67 + // resolves the product-prefixed label without an N+1 per row.
68 + $with = ['customer', 'product'];
67 69
68 70 return $query->with($with)
69 71 ->where(function ($q) use ($searchTerms) {
70 72 $q->where('id', 'LIKE', "%{$searchTerms[0]}%")
@@ -105,8 +107,9 @@
105 107 public static function view($id)
106 108 {
107 109 return Subscription::where('id', $id)
108 110 ->with([
111 + 'product',
109 112 'customer.shipping_address' => function ($query) {
110 113 $query->where('is_primary', 1);
111 114 },
112 115 'customer.billing_address' => function ($query) {