Closed miggf closed 5 years ago
I like your use of Lang::locale() - I hadn't thought of that.
Since the lookup method returns a Laravel collection, this should give you what you're looking for:
Countries::lookup(Lang::locale())->get('PT')
As an aside if you were planing to use more than one country from the collection, you could assign it to a local variable and then simply subscript it as shown below:
$lookup = Countries::lookup(Lang::locale());
echo $lookup['PT'];
echo $lookup['ES'];
I guess you could subscript the initial lookup method too, Countries::lookup(Lang::locale())['PT']
, but that's a bit ugly :).
Hi,
How can I search for a specific country in a specific language.
Something like this
Countries::lookup(Lang::locale(), 'PT')
Should give the fallowing Output:
Portugal
I can find this method on the documentation, there is any method to do this? It would be really useful...
Thanks, Miguel Ferreira