bumdes
This commit is contained in:
@@ -51,9 +51,13 @@ class KecamatanController extends Controller
|
||||
return response()->json($kecamatan);
|
||||
}
|
||||
|
||||
public function getByKabupaten($kabupaten_id)
|
||||
public function getByKabupaten(Request $request, $kabupaten_id)
|
||||
{
|
||||
$kecamatan = Kecamatan::where('kabupaten_kota_id', $kabupaten_id)
|
||||
$query = $request->boolean('all_wilayah')
|
||||
? Kecamatan::withoutGlobalScope('program')
|
||||
: Kecamatan::query();
|
||||
|
||||
$kecamatan = $query->where('kabupaten_kota_id', $kabupaten_id)
|
||||
->orderBy('nama', 'asc')
|
||||
->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user