user() !== null; } public function rules(): array { $options = app(PreferencesOptionsService::class); return [ 'receive_email_notifications' => ['nullable', 'boolean'], 'receive_sms_notifications' => ['nullable', 'boolean'], 'notification_email' => ['nullable', 'boolean'], 'notification_sms' => ['nullable', 'boolean'], 'theme' => ['nullable', 'string', Rule::in(['light', 'dark'])], 'language' => ['nullable', 'string', Rule::in(['en', 'fr', 'es'])], 'style_color' => ['nullable', 'string', Rule::in($options->styleOptions())], 'menu_color' => ['nullable', 'string', Rule::in($options->menuOptions())], ]; } }