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