<?php

namespace App\Http\Controllers\Site\Ajax;

use App\Models\Admin\City;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class CitySelectController extends Controller
{
    public function getCitySelect(Request $request)
    {
        $countryId = $request->input('country_id');

        $cities = City::where('country_id', $countryId)->orderBy('name')->get();

        return response()->json($cities);
    }
}
