CourseWork/app/Http/Requests/StudentPostRequest.php
2024-04-23 14:52:49 +04:00

37 lines
969 B
PHP

<?php
namespace App\Http\Requests;
use App\Enums\RoleEnum;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class StudentPostRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => 'required|max:255',
'last_name' => 'required|max:255',
'middle_name' => 'required|max:255',
'birthday' => 'required|date',
'grade_id' => 'required|exists:grades,id',
'login' => 'required|max:255|lowercase|unique:users,login',
'password' => 'required|max:255',
];
}
}