Files
boursecu_server/app/Http/Controllers/Site/CityController.php
T

24 lines
565 B
PHP
Raw Normal View History

2026-01-24 14:03:11 +00:00
<?php
namespace App\Http\Controllers\Site;
use App\Http\Controllers\Controller;
use App\Models\City;
use Illuminate\Http\Request;
class CityController extends Controller
{
public function stateList(){
$city = City::whereNull('parent_id')->get();
return response()->json($city);
}
public function cityList($state_id){
$city = City::where('parent_id',$state_id)->get();
return response()->json($city);
}
public function cityListAll(){
$city = City::all();
return response()->json($city);
}
}