-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Rinvex Country is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, and other attributes for all 250 countries worldwide at your fingertips.
Install via composer require rinvex/country
, then use as follows:
use Rinvex\Country\Models\Country;
// Find a country by it's ISO 3166-1 alpha-2
$egypt = (new Country)->find('EG');
// Find a country by one of it's attributes
$usa = (new Country)->findBy('capital', 'Washington D.C.');
// Find all countries
$countries = (new Country)->findAll();
// Retrieve only `name`, `demonym`, and `currency` attributes of "Japan":
$japan = (new Country)->find('JP', ['name', 'demonym', 'currency']);
// Utilize Laravel Collections to get an array of all country names, with their 'iso_3166_1_alpha2' as the array keys
(new Country)->findAll()->pluck('name.common', 'iso_3166_1_alpha2');
Mission accomplished! You're good to use this package right now! ✅
Unless you're new to this kind of stuff, you can skip the following steps! 😉
Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.
This software is released under The MIT License (MIT).
(c) 2016 Rinvex LLC, Some rights reserved.