lpj/app/Http/Requests/IjinUsahaRequest.php

38 lines
857 B
PHP
Raw Normal View History

<?php
namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class IjinUsahaRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
$rules = [
'nama_ijin_usaha' => 'required|string|not_regex:/^\d+$/|max:255'
];
return $rules;
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
public function messages(): array
{
return [
'nama_ijin_usaha.required' => 'Nama Ijin Usaha harus diisi!',
'nama_ijin_usaha.not_regex' => 'Nama Ijin Usaha harus berupa huruf!',
'nama_ijin_usaha.max' => 'Nama Ijin Usaha maksimal 255 huruf!'
];
}
}