940afe9319
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Test (PHPUnit) (push) Failing after 2m23s
API CI/CD / Build frontend assets (push) Successful in 2m18s
API CI/CD / Security audit (push) Successful in 31s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
40 lines
1011 B
PHP
40 lines
1011 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Parents;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateAuthorizedUserRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function prepareForValidation(): void
|
|
{
|
|
if ($this->has('email') && $this->input('email') === '') {
|
|
$this->merge(['email' => null]);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'email' => ['sometimes', 'nullable', 'string', 'email'],
|
|
'user_id' => ['prohibited'],
|
|
'authorized_user_id' => ['prohibited'],
|
|
'password' => ['prohibited'],
|
|
'password_confirmation' => ['prohibited'],
|
|
'password_confirm' => ['prohibited'],
|
|
'current_password' => ['prohibited'],
|
|
'role' => ['prohibited'],
|
|
'role_id' => ['prohibited'],
|
|
'roles' => ['prohibited'],
|
|
];
|
|
}
|
|
}
|