Update Koperasi

This commit is contained in:
2026-11-06 22:38:45 +07:00
parent 6232b28e11
commit cb36682d9e
79 changed files with 4639 additions and 1378 deletions
@@ -0,0 +1,44 @@
<?php
namespace App\Http\Requests\Koperasi;
use App\Services\Koperasi\PengurusKoperasiService;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Enum as EnumRule;
abstract class KoperasiRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
protected function prepareForValidation(): void
{
$values = [];
foreach (PengurusKoperasiService::RUPIAH_FIELDS as $field) {
if ($this->exists($field)) {
$values[$field] = PengurusKoperasiService::normalizeRupiah($this->input($field));
}
}
$this->merge($values);
}
public function messages(): array
{
return [
'required' => ':attribute wajib diisi.',
'exists' => 'Pilihan :attribute tidak ditemukan.',
'prohibited' => ':attribute belum tersedia.',
'string' => ':attribute harus berupa teks.',
'max.string' => ':attribute maksimal :max karakter.',
'integer' => ':attribute harus berupa bilangan bulat.',
'numeric' => ':attribute harus berupa angka.',
'array' => 'Pilihan :attribute tidak valid.',
'in' => 'Pilihan :attribute tidak valid.',
'min.numeric' => ':attribute minimal :min.',
'max.numeric' => ':attribute maksimal :max.',
EnumRule::class => 'Pilihan :attribute tidak valid.',
];
}
}