$offer = Offer::with([
'countries' => function ($query) {
$query->select('offer_countries.id', 'offer_countries.abbr');
}
])->findOrFail($id);
$offer->countries = $offer->countries->map(function($country) {
return $country->id;
});
return $offer;