forked from admin/services_core
24 lines
854 B
PHP
24 lines
854 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Wilayah;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class AlamatLengkapRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'desa_id' => ['nullable', 'required_without_all:kecamatan_id,kabupaten_id,provinsi_id', 'integer', 'exists:wilayah_desa,id'],
|
|
'kecamatan_id' => ['nullable', 'required_without_all:desa_id,kabupaten_id,provinsi_id', 'integer', 'exists:wilayah_kecamatan,id'],
|
|
'kabupaten_id' => ['nullable', 'required_without_all:desa_id,kecamatan_id,provinsi_id', 'integer', 'exists:wilayah_kabupaten,id'],
|
|
'provinsi_id' => ['nullable', 'required_without_all:desa_id,kecamatan_id,kabupaten_id', 'integer', 'exists:wilayah_provinsi,id'],
|
|
];
|
|
}
|
|
}
|