0, 'name' => '', 'address' => '', 'postal_code' => 0, 'city' => '', 'phone' => '', 'gmaps_embed_href' => 0, ]; /** * ShopResource * * @param \App\Models\Shop $shop */ public function __construct(Shop $shop) { $this->shop = $shop; } /** * Transform the resource into an array. * * @param mixed $request * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ public function toArray($request) { // phpcs:enable return array_intersect_key( $this->shop->toArray(), $this->skeleton ); } }