I have a ecommerce-web, In my controller I have a code that controls a list of countries that are displayed in the cart.
If the price of the country where we are is greater than or equal to the price of shipping to other countries, these countries are added to the list:

This is my controller code:
$params['final_countries_list'] = [];
$list_countries = Config::get('app.web_config.shipment.countries');
$base_price = $list_countries[Config::get('app.web_country')]['price'];
foreach($list_countries as $key=>$value) {
if ($value['price'] <= $base_price)
$params['final_countries_list'][$key] = $value;
}
Well, if I do a dd($params['final_countries_list']), I get this result.
array(13) {
["deu"] array(2) {
["name"] "Deutschland"
["price"] 9
}
["che"] array(2) {
["name"] "Schweiz"
["price"] 9
}
["fra"] array(2) {
["name"] "France"
["price"] 8
}
["gbr"] array(2) {
["name"] "United Kingdom"
["price"] 9
}
ETC,ETC...
Now I want to get this(deu, fra, gbr, etc) in view cart.blade.php
In the cart.blade.php have this code to get what I want:
<select name="country" id="pais">
<option value="" selected><--- Choose Country ---></option>
<?php foreach($final_countries_list as $key => $value){?>
<option value="<?php echo $key?>"><?php echo $value. ' ('.$key.')';?></option>
<?php } ?>
</select>
And I get the following error:
ErrorException (E_UNKNOWN) Array to string conversion (View: C:\xampp\htdocs\my_web_name\app\views\cart.blade.php)
How I can fix it?