| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class StudentResponsibleRequest extends FormRequest
- {
- public function rules(): array
- {
- return [
- 'student_id' => 'required|exists:students,id',
- 'name' => 'required|string|max:255',
- 'birth_date' => 'required|date',
- 'cpf' => 'required|string|max:20',
- 'gender' => 'nullable|string|in:male,female,other,no_preference',
- 'degree' => 'required|string|max:255',
- 'email' => 'required|email|max:255',
- 'phone' => 'required|string|max:20',
- 'street' => 'required|string|max:255',
- 'address_number' => 'nullable|string|max:20',
- 'postal_code' => 'required|string|max:10',
- 'neighborhood' => 'required|string|max:255',
- 'city_id' => 'required|exists:cities,id',
- 'state_id' => 'required|exists:states,id',
- 'complement' => 'nullable|string|max:255',
- 'notes' => 'nullable|string',
- ];
- }
- public function messages(): array
- {
- return [
- 'student_id.required' => 'O aluno é obrigatório.',
- 'student_id.exists' => 'Aluno não encontrado.',
- 'name.required' => 'O nome é obrigatório.',
- 'birth_date.required' => 'A data de nascimento é obrigatória.',
- 'cpf.required' => 'O CPF é obrigatório.',
- 'degree.required' => 'O grau de parentesco é obrigatório.',
- 'email.required' => 'O e-mail é obrigatório.',
- 'email.email' => 'Informe um e-mail válido.',
- 'phone.required' => 'O telefone é obrigatório.',
- 'street.required' => 'O endereço é obrigatório.',
- 'postal_code.required' => 'O CEP é obrigatório.',
- 'neighborhood.required' => 'O bairro é obrigatório.',
- 'city_id.required' => 'A cidade é obrigatória.',
- 'city_id.exists' => 'Cidade não encontrada.',
- 'state_id.required' => 'O estado é obrigatório.',
- 'state_id.exists' => 'Estado não encontrado.',
- ];
- }
- }
|