TIF_E41201014/app/Http/Requests/JurusanRequest.php

39 lines
783 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class JurusanRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
public function rules()
{
return [
'nama_jurusan' => 'required|regex:/^[a-zA-Z\s]+$/',
];
}
public function messages()
{
return [
'nama_jurusan.required' => 'Nama jurusan tidak boleh kosong',
'nama_jurusan.regex' => 'Nama jurusan hanya boleh berisi huruf dan spasi'
];
}
}