lpj/app/Http/Requests/JenisJaminanRequest.php
Daeng Deni Mardaeni be47e0678a Update Module Permohonan
- Update Automaticly get branch id by user login
- change static status permohonan to dynamic and database base
- update create permohonan, update selection debiture to table base
2024-09-03 13:41:05 +07:00

43 lines
1.0 KiB
PHP

<?php
namespace Modules\Lpj\Http\Requests;
use Haruncpi\LaravelIdGenerator\IdGenerator;
use Illuminate\Foundation\Http\FormRequest;
class JenisJaminanRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules()
: array
{
return [
'code' => 'required|max:5',
'name' => 'required|max:255',
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize()
: bool
{
return true;
}
public function prepareForValidation()
: void
{
if ($this->method() == 'POST') {
$this->merge([
'code' => IdGenerator::generate(
['table' => 'jenis_jaminan', 'length' => 5, 'prefix' => 'JJ', 'field' => 'code'],
),
]);
}
}
}