*/ public function toArray(Request $request): array { $content = $this->content($request->get("version", 0))->first(); return [ 'id' => $this->id, 'name' => $content?->name, 'library' => new LibrarySimpleResource($this->library), 'naming_rule' => new NamingRuleSimpleResource($this->namingRule), 'naming_rules' => $this->naming_rules, "doc_stage" => $this->doc_stage, "doc_type" => $this->doc_type, "version" => $this->version, 'approval_status' => $this->approval_status, "created_at" => (string)$this->created_at, "created_by" => new UserProfileResource($this->createdBy), ]; } }