Fixed checking of the language change
This commit is contained in:
parent
f6d0147419
commit
fb51659a04
1 changed files with 5 additions and 0 deletions
|
@ -9,12 +9,16 @@
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Requests\Base;
|
namespace Pterodactyl\Http\Requests\Base;
|
||||||
|
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
use Pterodactyl\Models\User;
|
use Pterodactyl\Models\User;
|
||||||
use Pterodactyl\Http\Requests\FrontendUserFormRequest;
|
use Pterodactyl\Http\Requests\FrontendUserFormRequest;
|
||||||
use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException;
|
use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException;
|
||||||
|
use Pterodactyl\Traits\Helpers\AvailableLanguages;
|
||||||
|
|
||||||
class AccountDataFormRequest extends FrontendUserFormRequest
|
class AccountDataFormRequest extends FrontendUserFormRequest
|
||||||
{
|
{
|
||||||
|
use AvailableLanguages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException
|
* @throws \Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException
|
||||||
|
@ -59,6 +63,7 @@ class AccountDataFormRequest extends FrontendUserFormRequest
|
||||||
'name_first' => array_get($modelRules, 'name_first'),
|
'name_first' => array_get($modelRules, 'name_first'),
|
||||||
'name_last' => array_get($modelRules, 'name_last'),
|
'name_last' => array_get($modelRules, 'name_last'),
|
||||||
'username' => array_get($modelRules, 'username'),
|
'username' => array_get($modelRules, 'username'),
|
||||||
|
'language' => 'required|string|' . Rule::in(array_keys($this->getAvailableLanguages())),
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue