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