Download the PHP package altwaireb/laravel-countries without Composer
On this page you can find all versions of the php package altwaireb/laravel-countries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download altwaireb/laravel-countries
More information about altwaireb/laravel-countries
Files in altwaireb/laravel-countries
Package laravel-countries
Short Description Laravel Countries , Countries States Cities DB Migration & Seeder
License MIT
Homepage https://github.com/altwaireb/laravel-countries
Informations about the package laravel-countries
Laravel Countries
This package allows you to add all Countries, States, and Cities data with DB Migration & Seeder for Laravel.
Numbers
Model | Number of items |
---|---|
Country | 250 |
State | 4961 |
City | 148059 |
Attributes
Common attributes:
name
: Common name of Country(english).iso2
: ISO-3166-2 code.iso2
: ISO-3166-3 code.numeric_code
: Country Numeric code.phonecode
: Country Phone code.capital
: Capital of this country.currency
: ISO-4177 Currency Code, e.g. USD, CNY.currency_name
: Currency Name.currency_symbol
: Currency Symbol e.g. $, ¥.tld
: Country code top-level domain e.g. .uk.native
: Local name of the country.region
: region of the country.subregion
: Sub-region of the country.timezones
: timezones the country.zoneName
: Zone Name e.g. America/New_York.gmtOffset
: GMT offset e.g. -18000.gmtOffsetName
: GMT offset Name e.g. UTC-05:00.abbreviation
: abbreviation e.g. EST.tzName
: time zone Name e.g. Eastern Standard Time (North America).
translations
: Country name translations e.g.- "ar": "الولايات المتحدة الأمريكية"
- "kr": "미국"
- "fr": "États-Unis"
latitude
: latitude the country.longitude
: latitude the country.emoji
: Emoji flag of country e.g. 🇺🇸.emojiU
: Emoji Unicode flag of country e.g U+1F1FA U+1F1F8.flag
: Country has flag (boolean).is_active
: Country has active (boolean).
Installation
You can install the package via composer:
Usage
Now run the following command to install .
Add seeder File in database\seeders\DatabaseSeeder.php
add this line to use php artisan db:seed
command.
Or you can Seed Data of Countries States Cities, by run this command.
And you can refresh to re-seeding Data of Countries States Cities, by run this command.
You can specify the activation of countries through the country code ISO2 or ISO3,
before processing the seed data in the config file. config/countries.php
If you need to insert the countries is activation , this insert only two Countries ( Albania , Argentina )
with States and Cities.
This means that only these two countries and the states and cities affiliated with them will be activated.
- Note: If activation only
iso2
aniso3
are empty, the column is_active take thedefault
value in config file. - Note: If Country is active, all States and Cities are active.
- Note: If activation except
iso2
oriso3
the column is_active take FALSE value. - Note: If Country is not active, all States and Cities are not active.
Usage
you can get country by iso2 and iso3 or both.
if you want to get country by iso2 you can yes static function getByIso2
if you want to get country by iso3 you can use.
also if you want to get country by code iso2 ro iso3 you can use.
Scope
you can use Scope to filter data is Active by use.
Credits
- Abdulmajeed Altwaireb
- Alexandre Plennevaux (Edit readme)
- All Contributors
All versions of laravel-countries with dependencies
spatie/laravel-package-tools Version ^1.16.4
illuminate/contracts Version ^10.0||^11.0||^12.0