2017-12-15 03:05:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Admin\Settings;
|
|
|
|
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
use Pterodactyl\Traits\Helpers\AvailableLanguages;
|
|
|
|
use Pterodactyl\Http\Requests\Admin\AdminFormRequest;
|
|
|
|
|
|
|
|
class BaseSettingsFormRequest extends AdminFormRequest
|
|
|
|
{
|
|
|
|
use AvailableLanguages;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
2020-09-26 23:29:26 +00:00
|
|
|
'app:name' => 'required|string|max:191',
|
2017-12-15 03:05:26 +00:00
|
|
|
'pterodactyl:auth:2fa_required' => 'required|integer|in:0,1,2',
|
|
|
|
'app:locale' => ['required', 'string', Rule::in(array_keys($this->getAvailableLanguages()))],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function attributes()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'app:name' => 'Company Name',
|
|
|
|
'pterodactyl:auth:2fa_required' => 'Require 2-Factor Authentication',
|
|
|
|
'app:locale' => 'Default Language',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|