Files
water-back/modules/Mall/Http/Resources/Api/Shop/ShopEditResource.php
2023-01-12 14:47:38 +08:00

36 lines
986 B
PHP

<?php
namespace Modules\Mall\Http\Resources\Api\Shop;
use Illuminate\Http\Resources\Json\JsonResource;
class ShopEditResource extends JsonResource
{
public function toArray($request): array
{
return [
'shop_id' => $this->id,
'name' => $this->name,
'mobile' => $this->mobile,
'cover' => $this->cover_url,
'description' => $this->description,
'province' => [
'id' => $this->province_id,
'name' => $this->province->name,
],
'city' => [
'id' => $this->city_id,
'name' => $this->city->name,
],
'district' => [
'id' => $this->district_id,
'name' => $this->district->name,
],
'address' => $this->address ?? '',
'created_at' => (string) $this->created_at,
];
}
}