*/ public function rules(): array { return [ 'title' => 'required|string|max:255', 'description' => 'nullable|string|max:2000', 'vcpu' => 'required|integer|min:0', 'ram' => 'required|integer|min:0', 'disk' => 'required|integer|min:0', 'domain' => 'required|integer|min:0', 'bandwidth' => 'nullable|integer|min:0', 'databases' => 'nullable|integer|min:0', 'mailboxes' => 'nullable|integer|min:0', 'mailbox_quota' => 'nullable|integer|min:0', 'ftp_accounts' => 'nullable|integer|min:0', 'subdomains' => 'nullable|integer|min:0', 'domain_aliases' => 'nullable|integer|min:0', 'features' => 'nullable|array|max:30', 'features.*' => 'string|distinct|max:100', 'is_active' => 'boolean', 'sort_order' => 'nullable|integer|min:0', 'dns_manager_server_id' => 'nullable|integer|exists:dns_manager_servers,id', 'plesk_plan_name' => 'nullable|string|max:255', 'note' => 'nullable|string', ]; } /** * @return array */ public function planAttributes(): array { $validated = $this->validated(); return [ ...collect($validated)->except(['plesk_plan_name', 'note'])->all(), 'dns_manager_server_id' => $validated['dns_manager_server_id'] ?? null, 'sort_order' => $validated['sort_order'] ?? 0, 'is_active' => $validated['is_active'] ?? true, ]; } }