27 lines
679 B
PHP
27 lines
679 B
PHP
<?php
|
|
|
|
namespace App\Endpoint\Api\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class OrderPreResource 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,
|
|
'store_id' => $this->store_id,
|
|
'user_id' => $this->user_id,
|
|
'products' => $this->products,
|
|
'others' => $this->others,
|
|
'created_at' => $this->created_at->timestamp,
|
|
];
|
|
}
|
|
}
|