29 lines
753 B
PHP
29 lines
753 B
PHP
<?php
|
|
|
|
namespace App\Endpoint\Api\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AddressResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'consignee' => $this->consignee,
|
|
'telephone' => $this->telephone,
|
|
'province' => $this->province,
|
|
'city' => $this->city,
|
|
'district' => $this->district,
|
|
'address' => $this->address,
|
|
'is_default' => $this->is_default,
|
|
];
|
|
}
|
|
}
|