24 lines
565 B
PHP
Executable File
24 lines
565 B
PHP
Executable File
<?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);
|
|
}
|
|
}
|