37 lines
957 B
PHP
37 lines
957 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreSantriRequest 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 [
|
|
'nama' => 'required|string|max:255',
|
|
'kelas_id' => 'required|exists:kelas,id',
|
|
'alamat' => 'required|string',
|
|
'tanggal_lahir' => 'required|date',
|
|
'jenis_kelamin' => 'required|in:L,P',
|
|
'tempat_lahir' => 'required|string',
|
|
'no_telp' => 'nullable|string|max:20', // ⬅️ tambahkan ini
|
|
'foto' => 'nullable|image|max:2048',
|
|
];
|
|
}
|
|
|
|
}
|