2023-02-02 15:45:17 +00:00
|
|
|
<?php
|
|
|
|
|
2023-02-06 20:16:54 +00:00
|
|
|
namespace App\Settings;
|
2023-02-02 15:45:17 +00:00
|
|
|
|
|
|
|
use Spatie\LaravelSettings\Settings;
|
|
|
|
|
|
|
|
class UserSettings extends Settings
|
|
|
|
{
|
|
|
|
public float $credits_reward_after_verify_discord;
|
|
|
|
|
|
|
|
public float $credits_reward_after_verify_email;
|
|
|
|
|
|
|
|
public bool $force_discord_verification;
|
|
|
|
|
|
|
|
public bool $force_email_verification;
|
|
|
|
|
|
|
|
public float $initial_credits;
|
|
|
|
|
|
|
|
public int $initial_server_limit;
|
|
|
|
|
|
|
|
public float $min_credits_to_make_server;
|
|
|
|
|
|
|
|
public int $server_limit_after_irl_purchase;
|
|
|
|
|
|
|
|
public int $server_limit_after_verify_discord;
|
|
|
|
|
|
|
|
public int $server_limit_after_verify_email;
|
|
|
|
|
|
|
|
public bool $register_ip_check;
|
|
|
|
|
|
|
|
public bool $creation_enabled;
|
|
|
|
|
|
|
|
public static function group(): string
|
|
|
|
{
|
|
|
|
return 'user';
|
|
|
|
}
|
2023-02-09 21:34:34 +00:00
|
|
|
|
2023-02-09 23:31:27 +00:00
|
|
|
/**
|
|
|
|
* Summary of validations array
|
|
|
|
* @return array<string, string>
|
|
|
|
*/
|
|
|
|
public static function getValidations()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'credits_reward_after_verify_discord' => 'required|numeric',
|
|
|
|
'credits_reward_after_verify_email' => 'required|numeric',
|
|
|
|
'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|string',
|
|
|
|
'creation_enabled' => 'nullable|string',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2023-02-09 21:34:34 +00:00
|
|
|
/**
|
|
|
|
* Summary of optionTypes
|
|
|
|
* Only used for the settings page
|
|
|
|
* @return array<array<'type'|'label'|'description'|'options', string|boolean|number|array<string, string>>>
|
|
|
|
*/
|
|
|
|
public static function getOptionInputData()
|
|
|
|
{
|
|
|
|
return [
|
2023-02-20 12:44:06 +00:00
|
|
|
'category_icon' => 'fas fa-user',
|
2023-02-09 21:34:34 +00:00
|
|
|
'credits_reward_after_verify_discord' => [
|
|
|
|
'label' => 'Credits Reward After Verify Discord',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of credits a user gets after verifying their discord account.',
|
|
|
|
],
|
|
|
|
'credits_reward_after_verify_email' => [
|
|
|
|
'label' => 'Credits Reward After Verify Email',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of credits a user gets after verifying their email.',
|
|
|
|
],
|
|
|
|
'force_discord_verification' => [
|
|
|
|
'label' => 'Force Discord Verification',
|
2023-02-11 15:02:02 +00:00
|
|
|
'type' => 'boolean',
|
2023-02-09 21:34:34 +00:00
|
|
|
'description' => 'Force users to verify their discord account.',
|
|
|
|
],
|
|
|
|
'force_email_verification' => [
|
|
|
|
'label' => 'Force Email Verification',
|
2023-02-11 15:02:02 +00:00
|
|
|
'type' => 'boolean',
|
2023-02-09 21:34:34 +00:00
|
|
|
'description' => 'Force users to verify their email.',
|
|
|
|
],
|
|
|
|
'initial_credits' => [
|
|
|
|
'label' => 'Initial Credits',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of credits a user gets when they register.',
|
|
|
|
],
|
|
|
|
'initial_server_limit' => [
|
|
|
|
'label' => 'Initial Server Limit',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of servers a user can create when they register.',
|
|
|
|
],
|
|
|
|
'min_credits_to_make_server' => [
|
|
|
|
'label' => 'Min Credits To Make Server',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The minimum amount of credits a user needs to create a server.',
|
|
|
|
],
|
|
|
|
'server_limit_after_irl_purchase' => [
|
|
|
|
'label' => 'Server Limit After IRL Purchase',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of servers a user can create after they purchase a server.',
|
|
|
|
],
|
|
|
|
'server_limit_after_verify_discord' => [
|
|
|
|
'label' => 'Server Limit After Verify Discord',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of servers a user can create after they verify their discord account.',
|
|
|
|
],
|
|
|
|
'server_limit_after_verify_email' => [
|
|
|
|
'label' => 'Server Limit After Verify Email',
|
|
|
|
'type' => 'number',
|
|
|
|
'description' => 'The amount of servers a user can create after they verify their email.',
|
|
|
|
],
|
|
|
|
'register_ip_check' => [
|
|
|
|
'label' => 'Register IP Check',
|
|
|
|
'type' => 'boolean',
|
|
|
|
'description' => 'Check if the IP a user is registering from is already in use.',
|
|
|
|
],
|
|
|
|
'creation_enabled' => [
|
|
|
|
'label' => 'Creation Enabled',
|
|
|
|
'type' => 'boolean',
|
|
|
|
'description' => 'Whether or not users can create servers.',
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|