Ver código fonte

Fix Settings bool -> String

1day2die 2 anos atrás
pai
commit
9dbd812fc2

+ 5 - 5
app/Settings/GeneralSettings.php

@@ -8,11 +8,11 @@ class GeneralSettings extends Settings
 {
     public bool $store_enabled;
     public string $credits_display_name;
-    public ?bool $recaptcha_enabled;
+    public bool $recaptcha_enabled;
     public ?string $recaptcha_site_key;
     public ?string $recaptcha_secret_key;
     public ?string $phpmyadmin_url;
-    public ?bool $alert_enabled;
+    public bool $alert_enabled;
     public string $alert_type;
     public ?string $alert_message;
     public string $theme;
@@ -33,13 +33,13 @@ class GeneralSettings extends Settings
     public static function getValidations()
     {
         return [
-            'store_enabled' => 'boolean',
+            'store_enabled' => 'nullable|string',
             'credits_display_name' => 'required|string',
-            'recaptcha_enabled' => 'nullable|boolean',
+            'recaptcha_enabled' => 'nullable|string',
             'recaptcha_site_key' => 'nullable|string',
             'recaptcha_secret_key' => 'nullable|string',
             'phpmyadmin_url' => 'nullable|string',
-            'alert_enabled' => 'nullable|boolean',
+            'alert_enabled' => 'nullable|string',
             'alert_type' => 'required|in:primary,secondary,success,danger,warning,info',
             'alert_message' => 'nullable|string',
             'theme' => 'required|in:default,BlueInfinity' // TODO: themes should be made/loaded dynamically

+ 1 - 1
app/Settings/InvoiceSettings.php

@@ -33,7 +33,7 @@ class InvoiceSettings extends Settings
             'company_phone' => 'nullable|string',
             'company_vat' => 'nullable|string',
             'company_website' => 'nullable|string',
-            'enabled' => 'nullable|boolean',
+            'enabled' => 'nullable|string',
             'prefix' => 'nullable|string',
         ];
     }

+ 2 - 2
app/Settings/LocaleSettings.php

@@ -25,10 +25,10 @@ class LocaleSettings extends Settings
     {
         return [
             'available' => 'nullable|array',
-            'clients_can_change' => 'nullable|boolean',
+            'clients_can_change' => 'nullable|string',
             'datatables' => 'nullable|string',
             'default' => 'required|in:' . implode(',', config('app.available_locales')),
-            'dynamic' => 'nullable|boolean',
+            'dynamic' => 'nullable|string',
         ];
     }
 

+ 1 - 1
app/Settings/MailSettings.php

@@ -52,7 +52,7 @@ class MailSettings extends Settings
             'mail_from_address' => 'nullable|string',
             'mail_from_name' => 'nullable|string',
             'mail_mailer' => 'nullable|string',
-            'mail_enabled' => 'nullable|boolean',
+            'mail_enabled' => 'nullable|string',
         ];
     }
 

+ 2 - 2
app/Settings/ReferralSettings.php

@@ -24,8 +24,8 @@ class ReferralSettings extends Settings
     public static function getValidations()
     {
         return [
-            'always_give_commission' => 'nullable|boolean',
-            'enabled' => 'nullable|boolean',
+            'always_give_commission' => 'nullable|string',
+            'enabled' => 'nullable|string',
             'reward' => 'nullable|numeric',
             'mode' => 'required|in:comission,sign-up,both',
             'percentage' => 'nullable|numeric',

+ 3 - 3
app/Settings/ServerSettings.php

@@ -24,9 +24,9 @@ class ServerSettings extends Settings
     {
         return [
             'allocation_limit' => 'required|integer|min:0',
-            'creation_enabled' => 'nullable|boolean',
-            'enable_upgrade' => 'nullable|boolean',
-            'charge_first_hour' => 'nullable|boolean',
+            'creation_enabled' => 'nullable|string',
+            'enable_upgrade' => 'nullable|string',
+            'charge_first_hour' => 'nullable|string',
         ];
     }
 

+ 1 - 1
app/Settings/TicketSettings.php

@@ -21,7 +21,7 @@ class TicketSettings extends Settings
     public static function getValidations()
     {
         return [
-            'enabled' => 'nullable|boolean',
+            'enabled' => 'nullable|string',
             'information' => 'nullable|string',
         ];
     }

+ 4 - 4
app/Settings/UserSettings.php

@@ -33,16 +33,16 @@ class UserSettings extends Settings
         return [
             'credits_reward_after_verify_discord' => 'required|numeric',
             'credits_reward_after_verify_email' => 'required|numeric',
-            'force_discord_verification' => 'nullable|boolean',
-            'force_email_verification' => 'nullable|boolean',
+            'force_discord_verification' => 'nullable|string',
+            'force_email_verification' => 'nullable|string',
             'initial_credits' => 'required|numeric',
             'initial_server_limit' => 'required|numeric',
             'min_credits_to_make_server' => 'required|numeric',
             'server_limit_after_irl_purchase' => 'required|numeric',
             'server_limit_after_verify_discord' => 'required|numeric',
             'server_limit_after_verify_email' => 'required|numeric',
-            'register_ip_check' => 'nullable|boolean',
-            'creation_enabled' => 'nullable|boolean',
+            'register_ip_check' => 'nullable|string',
+            'creation_enabled' => 'nullable|string',
         ];
     }
 

+ 6 - 6
app/Settings/WebsiteSettings.php

@@ -31,13 +31,13 @@ class WebsiteSettings extends Settings
     public static function getValidations()
     {
         return [
-            'motd_enabled' => 'nullable|boolean',
+            'motd_enabled' => 'nullable|string',
             'motd_message' => 'nullable|string',
-            'show_imprint' => 'nullable|boolean',
-            'show_privacy' => 'nullable|boolean',
-            'show_tos' => 'nullable|boolean',
-            'useful_links_enabled' => 'nullable|boolean',
-            'enable_login_logo' => 'nullable|boolean',
+            'show_imprint' => 'nullable|string',
+            'show_privacy' => 'nullable|string',
+            'show_tos' => 'nullable|string',
+            'useful_links_enabled' => 'nullable|string',
+            'enable_login_logo' => 'nullable|string',
             'seo_title' => 'nullable|string',
             'seo_description' => 'nullable|string',
         ];