*/ public function toArray(Request $request): array { return [ 'domain' => new DomainResource($this->resource), 'ns_count' => (int) ($this->record_count ?? 0), 'records' => $this->records ? new DomainNSCollection($this->records) : [ 'items' => [], 'pagination' => [ 'total' => 0, 'per_page' => 0, 'current_page' => 1, 'last_page' => 1, ], ], ]; } }