Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Http/Requests/FrontendUserFormRequest.php
10279 views
1
<?php
2
3
namespace Pterodactyl\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
abstract class FrontendUserFormRequest extends FormRequest
8
{
9
abstract public function rules(): array;
10
11
/**
12
* Determine if a user is authorized to access this endpoint.
13
*/
14
public function authorize(): bool
15
{
16
return !is_null($this->user());
17
}
18
19
/**
20
* Return only the fields that we are interested in from the request.
21
* This will include empty fields as a null value.
22
*/
23
public function normalize(): array
24
{
25
return $this->only(
26
array_keys($this->rules())
27
);
28
}
29
}
30
31