Files
panel-pelican-dev/app/Http/Requests/Admin/Settings/AdvancedSettingsFormRequest.php

51 lines
1.9 KiB
PHP
Raw Normal View History

<?php
2024-03-12 22:39:16 -04:00
namespace App\Http\Requests\Admin\Settings;
2024-03-12 22:39:16 -04:00
use App\Http\Requests\Admin\AdminFormRequest;
class AdvancedSettingsFormRequest extends AdminFormRequest
{
/**
* Return all the rules to apply to this request's data.
*/
public function rules(): array
{
return [
'recaptcha:enabled' => 'required|in:true,false',
'recaptcha:secret_key' => 'required|string|max:191',
'recaptcha:website_key' => 'required|string|max:191',
2024-03-12 22:39:16 -04:00
'panel:guzzle:timeout' => 'required|integer|between:1,60',
'panel:guzzle:connect_timeout' => 'required|integer|between:1,60',
'panel:client_features:allocations:enabled' => 'required|in:true,false',
'panel:client_features:allocations:range_start' => [
'nullable',
2024-03-12 22:39:16 -04:00
'required_if:panel:client_features:allocations:enabled,true',
'integer',
'between:1024,65535',
],
2024-03-12 22:39:16 -04:00
'panel:client_features:allocations:range_end' => [
'nullable',
2024-03-12 22:39:16 -04:00
'required_if:panel:client_features:allocations:enabled,true',
'integer',
'between:1024,65535',
2024-03-12 22:39:16 -04:00
'gt:panel:client_features:allocations:range_start',
],
];
}
public function attributes(): array
{
return [
'recaptcha:enabled' => 'reCAPTCHA Enabled',
'recaptcha:secret_key' => 'reCAPTCHA Secret Key',
'recaptcha:website_key' => 'reCAPTCHA Website Key',
2024-03-12 22:39:16 -04:00
'panel:guzzle:timeout' => 'HTTP Request Timeout',
'panel:guzzle:connect_timeout' => 'HTTP Connection Timeout',
'panel:client_features:allocations:enabled' => 'Auto Create Allocations Enabled',
'panel:client_features:allocations:range_start' => 'Starting Port',
'panel:client_features:allocations:range_end' => 'Ending Port',
];
}
}