user()?->can('manage-settings') ?? false; } public function rules(): array { return [ 'name' => ['required', 'string', 'max:190'], 'slug' => ['required', 'string', 'max:190', 'alpha_dash', 'unique:sms_templates,slug'], // Content is required unless template allows custom body 'content' => [Rule::requiredIf(fn () => ! (bool) $this->input('allow_custom_body')), 'nullable', 'string', 'max:1000'], 'variables_json' => ['nullable', 'array'], 'is_active' => ['sometimes', 'boolean'], 'default_profile_id' => ['nullable', 'integer', 'exists:sms_profiles,id'], 'default_sender_id' => ['nullable', 'integer', 'exists:sms_senders,id'], 'allow_custom_body' => ['sometimes', 'boolean'], 'action_id' => ['nullable', 'integer', 'exists:actions,id'], 'decision_id' => ['nullable', 'integer', 'exists:decisions,id'], ]; } }