Files
2026-02-16 09:29:37 +00:00

24 lines
565 B
PHP

<?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);
}
}