@php
$storesArray = $availableStores->map(function($countryStore) {
$translation = $countryStore->store->translations->first();
return [
'id' => $countryStore->id,
'name' => $translation->name ?? 'Store #' . $countryStore->store_id
];
})->toArray();
$selectedStore = isset($offer) ? $offer->country_store_id : old('country_store_id');
@endphp
@php
$brandsArray = $brands->map(function($brand) {
$translation = $brand->translations->first();
return [
'id' => $brand->id,
'name' => $translation->name ?? 'Brand #' . $brand->id
];
})->toArray();
$selectedBrand = isset($offer) ? $offer->brand_id : old('brand_id');
@endphp