address_id)->first(); 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, 'address' => new \App\Http\Resources\AddressBook($addressBook), 'complete' => (float)$this->complete, 'date' => $this->created_at->format('d/m/Y'), 'current_step' => [ 'details' => (new GetStep())->execute($this->current_step), 'attachments' => (new StepAttachments())->execute($this->id, $this->current_step) ], 'steps' => OrderStepResource::collection(OrderStep::where('order_id', $this->id)->orderBy('sequence')->get()), 'details' => (new ListsOrderHistory())->execute($this->id, $this->created_at, $this->complete, $this->updated_at) ]; } }