Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Http/Requests/Admin/UserFormRequest.php
10266 views
1
<?php
2
3
namespace Pterodactyl\Http\Requests\Admin;
4
5
use Pterodactyl\Models\User;
6
use Illuminate\Support\Collection;
7
8
class UserFormRequest extends AdminFormRequest
9
{
10
/**
11
* Rules to apply to requests for updating or creating a user
12
* in the Admin CP.
13
*/
14
public function rules(): array
15
{
16
return Collection::make(
17
User::getRulesForUpdate($this->route()->parameter('user'))
18
)->only([
19
'email',
20
'username',
21
'name_first',
22
'name_last',
23
'password',
24
'language',
25
'root_admin',
26
])->toArray();
27
}
28
}
29
30