parameter('server', Server::class)); return [ 'external_id' => $rules['external_id'], 'name' => $rules['name'], 'owner_id' => $rules['owner_id'], 'description' => array_merge(['nullable'], $rules['description']), ]; } /** * Normalize the validated data for the service. * * @return ServerDetailsModificationData */ public function payload(): array { return [ 'external_id' => $this->filled('external_id') ? $this->string('external_id')->toString() : null, 'name' => $this->string('name')->toString(), 'owner_id' => $this->integer('owner_id'), 'description' => $this->filled('description') ? $this->string('description')->toString() : null, ]; } /** Rename fields to be more clear in error messages. */ public function attributes(): array { return [ 'owner_id' => 'User ID', 'name' => 'Server Name', ]; } }