Download the PHP package aaix/laravel-countries without Composer

On this page you can find all versions of the php package aaix/laravel-countries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-countries

Laravel Countries Logo

Laravel Countries

A modern Laravel country-data package — idempotent seeders, zero-touch install, ergonomic API.

Opinionated fork of lwwcas/laravel-countries.

Latest Version on Packagist Total Downloads GitHub Actions License


Install

Migrations load automatically via the package service provider.

Seed

Seeds 5 regions, 245 countries, 9 language translations and the native_name column. Idempotent — safe to re-run. See Seeding for deploy-pipeline integration.

Principle

A country-data package should do exactly two things: create the tables and keep the rows in sync. Three commands (composer require, php artisan migrate, php artisan db:seed) do both. The seeders are idempotent, so running them on every deploy keeps rows in sync with no extra wiring.

Migrating from lwwcas/laravel-countries

Same 7-table schema, same Eloquent models, same query scopes, same country data. Migration is mostly a namespace swap — see the step-by-step guide in the docs:

Migrating from lwwcas

Usage

Available query scopes: whereIso, whereIsoAlpha2, whereIsoAlpha3, whereIsoNumeric, whereCurrency, whereBorders, whereDomain, whereLanguages, whereFlagColors, wherePhoneCode, whereIndependenceDay, whereStatistics, whereName, whereSlug, whereWmo.

Table layout

Table Purpose
lc_regions 5 continents (Africa, Americas, Asia, Europe, Oceania)
lc_region_translations Region names per locale
lc_countries 245 countries — ISO codes, capital, currency, flag metadata, native_name, population, GDP etc.
lc_countries_translations Country name + slug per locale
lc_countries_coordinates Latitude/longitude and formatted coordinate variants
lc_countries_geographical Country outline as GeoJSON
lc_countries_extras Religions, international orgs, national sport, internet stats, cybersecurity agency

Translations are handled by astrotomic/laravel-translatable (already a dependency). The withTranslation() global scope eager-loads the current locale + fallback locale — so Country::all()->pluck('name') is one query, not N+1.

Requirements

Testing

Credits

License

MIT. See LICENSE.md.


All versions of laravel-countries with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version >=11.0
astrotomic/laravel-translatable Version ^11.8
spatie/laravel-package-tools Version ^1.92
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aaix/laravel-countries contains the following files

Loading the files please wait ...