public function get_by_country(Request $request)
{
abort_unless(Gate::allows('city_access'), 401);
if (!$request->country_id) {
$html = '<option value="">'.trans('global.pleaseSelect').'</option>';
} else {
$html = '';
$cities = City::where('country_id', $request->country_id)->get();
foreach ($cities as $city) {
$html .= '<option value="'.$city->id.'">'.$city->name.'</option>';
}
}
return response()->json(['html' => $html]);
}