sarga/packages/Webkul/API/Http/Resources/Sales/OrderAddress.php

33 lines
988 B
PHP
Raw Normal View History

2019-03-13 11:17:52 +00:00
<?php
namespace Webkul\API\Http\Resources\Sales;
use Illuminate\Http\Resources\Json\JsonResource;
class OrderAddress 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,
'email' => $this->email,
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'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
];
}
}