sarga/packages/Webkul/API/Http/Resources/Customer/CustomerAddress.php

34 lines
1002 B
PHP
Raw Normal View History

2019-03-13 11:17:52 +00:00
<?php
namespace Webkul\API\Http\Resources\Customer;
use Illuminate\Http\Resources\Json\JsonResource;
class CustomerAddress extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return [
2020-02-19 11:24:04 +00:00
'id' => $this->id,
2020-03-23 07:01:28 +00:00
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'company_name' => $this->company_name,
2020-02-19 11:24:04 +00:00
'address1' => explode(PHP_EOL, $this->address1),
'country' => $this->country,
'country_name' => core()->country_name($this->country),
2020-02-19 11:24:04 +00:00
'state' => $this->state,
'city' => $this->city,
'postcode' => $this->postcode,
'phone' => $this->phone,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
2019-03-13 11:17:52 +00:00
];
}
2020-03-23 07:01:28 +00:00
}