2017-06-11 03:28:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Admin;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\User;
|
2019-12-08 19:02:59 +00:00
|
|
|
use Illuminate\Support\Collection;
|
2017-06-11 03:28:44 +00:00
|
|
|
|
|
|
|
class UserFormRequest extends AdminFormRequest
|
|
|
|
{
|
|
|
|
/**
|
2018-01-01 18:13:08 +00:00
|
|
|
* Rules to apply to requests for updating or creating a user
|
|
|
|
* in the Admin CP.
|
2017-06-11 03:28:44 +00:00
|
|
|
*/
|
2022-10-14 16:59:20 +00:00
|
|
|
public function rules(): array
|
2017-06-11 03:28:44 +00:00
|
|
|
{
|
2019-12-08 19:02:59 +00:00
|
|
|
return Collection::make(
|
|
|
|
User::getRulesForUpdate($this->route()->parameter('user'))
|
|
|
|
)->only([
|
|
|
|
'email',
|
|
|
|
'username',
|
|
|
|
'name_first',
|
|
|
|
'name_last',
|
|
|
|
'password',
|
|
|
|
'language',
|
|
|
|
'root_admin',
|
2018-01-01 18:13:08 +00:00
|
|
|
])->toArray();
|
2017-06-11 03:28:44 +00:00
|
|
|
}
|
|
|
|
}
|