resource; return [ 'id' => $note->id, 'type' => $note->type, 'name' => $note->name, 'notes' => $note->notes, 'is_default' => $note->is_default, 'company' => $this->when( $note->company()->exists(), fn () => new CompanyResource($note->company) ), ]; } }