Fix Settings bool -> String (#828)

This commit is contained in:
Dennis 2023-05-08 14:43:21 +02:00 committed by GitHub
commit f1d5856bba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 25 deletions

View file

@ -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

View file

@ -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',
];
}

View file

@ -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',
];
}

View file

@ -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',
];
}

View file

@ -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',

View file

@ -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',
];
}

View file

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

View file

@ -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',
];
}

View file

@ -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',
];