parameter('server', Server::class)); return [ 'external_id' => $rules['external_id'], 'name' => $rules['name'], 'user' => $rules['owner_id'], 'description' => array_merge(['nullable'], $rules['description']), ]; } /** * Convert the posted data into the correct format that is expected * by the application. * * @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('user'), 'description' => $this->filled('description') ? $this->string('description')->toString() : null, ]; } /** * Rename some attributes in error messages to clarify the field * being discussed. */ public function attributes(): array { return [ 'user' => 'User ID', 'name' => 'Server Name', ]; } }