Вы можете установить отношения между ними.
Модель страны:
public function states(){
return $this->hasMany(State::class);
}
public function statesWithCities(){
return $this->states()->with('cities');
}
Государственная модель:
public function cities(){
return $this->hasMany(City::class);
}
public function country(){
return $this->belongsTo(Country::class);
}
Модель города:
public function state(){
return $this->belongsTo(State::class);
}
и вы можете получить все страны, штаты, города с кодом:
Country::latest()->with('statesWithCities')->get()