sarga/packages/Sarga/API/Http/Resources/Customer/AddressResource.php

28 lines
751 B
PHP
Raw Normal View History

2022-02-07 14:30:10 +00:00
<?php
namespace Sarga\API\Http\Resources\Customer;
use Illuminate\Http\Resources\Json\JsonResource;
class AddressResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'note' => $this->company_name,
'address1' => explode(PHP_EOL, $this->address1),
'state' => $this->state,
'city' => $this->city,
2022-03-09 08:49:38 +00:00
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'phone' => $this->phone,
2022-02-07 14:30:10 +00:00
];
}
}