feat: add province and city routes for registration
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\City;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class LocationController extends Controller
|
||||
{
|
||||
public function getCities($provinceId): JsonResponse
|
||||
{
|
||||
$cities = City::where('province_id', $provinceId)
|
||||
->orderBy('name')
|
||||
->get(['id', 'name']);
|
||||
|
||||
return response()->json($cities);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user