Initial commit

This commit is contained in:
2026-04-12 06:24:30 +00:00
commit 007f107be6
213 changed files with 25576 additions and 0 deletions
@@ -0,0 +1,33 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\District;
use App\Models\Regency;
use App\Models\Village;
use Illuminate\Http\JsonResponse;
class RegionController extends Controller
{
public function regencies(string $provinceId): JsonResponse
{
return response()->json(
Regency::where('province_id', $provinceId)->orderBy('name')->get(['id', 'name'])
);
}
public function districts(string $regencyId): JsonResponse
{
return response()->json(
District::where('regency_id', $regencyId)->orderBy('name')->get(['id', 'name'])
);
}
public function villages(string $districtId): JsonResponse
{
return response()->json(
Village::where('district_id', $districtId)->orderBy('name')->get(['id', 'name'])
);
}
}