lk-students/app/Http/Requests/ProfileUpdateRequest.php

30 lines
712 B
PHP
Raw Permalink Normal View History

2024-06-19 13:42:36 +03:00
<?php
namespace App\Http\Requests;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ProfileUpdateRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
2024-06-19 16:40:34 +03:00
'email' => [
'required',
'string',
'lowercase',
'email',
'max:255',
Rule::unique(User::class)->ignore($this->user()->id)],
2024-06-19 13:42:36 +03:00
];
}
}