mirror of
https://gitlab.com/omair-personal/izyim.git
synced 2026-08-19 20:34:09 +00:00
8a28eb1790
This reverts merge request !5
39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Classes\Modules\Orders\Services\ListsOrderHistory;
|
|
use App\Classes\Modules\Steps\GetStep;
|
|
use App\Classes\Modules\Steps\StepAttachments;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class Order extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'company_id' => $this->company_id,
|
|
'marking' => $this->marking,
|
|
'forwarder_id' => $this->forwarder_id,
|
|
'supplier_id' => $this->supplier_id,
|
|
'warehouse_id' => $this->warehouse_id,
|
|
'current_step' => $this->current_step,
|
|
'complete' => (float)$this->complete,
|
|
'date' => $this->created_at->format('d/m/Y'),
|
|
'steps' => [
|
|
'details' => (new GetStep())->execute($this->current_step),
|
|
'attachments' => (new StepAttachments())->execute($this->id, $this->current_step)
|
|
],
|
|
'details' => (new ListsOrderHistory())->execute($this->id, $this->created_at, $this->complete, $this->updated_at)
|
|
];
|
|
}
|
|
|
|
}
|