AB
Size: a a a
AB
AB
AP
AP
AB
AB
AP
AP
AP
AB
AB
AP
AP
AB
AB
$result = Product::whereHas('product_availabilities', static function (Builder $query) use ($store_id) {
$query->where('store_id', $store_id);
})->get();
return new ProductCollection($result);
AB
AB
AB
I
AP
class UserCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'data' => $this->collection,
'links' => [
'self' => 'link-value',
],
];
}
}