Download the PHP package io238/laravel-iso-countries without Composer

On this page you can find all versions of the php package io238/laravel-iso-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-iso-countries

Laravel ISO Countries

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package provides ready-to-use application models and seeds the database with ISO data from various sources. This package can be used in multi-language apps and supports Country/Language/Currency names in almost any locale.

Included datasets

Unlike other packages, this one also includes relevant data relationships, such as:

Installation

You can install the package via composer:

The latest version of this package requires PHP version 8.0 or above. If you need support for PHP 7.4, please install version 2 of this package.

Migrations

There is no need to run any migrations. All country data information is stored in a pre-compiled SQLITE database that is stored within this package.

By default, this database includes all country/language/&currency names translated into English, German, French, and Spanish. If you want to compile your own database with other languages, please see the instructions here.

Rebuilding the database

Country-level ISO data does not change very often. Nevertheless, if at any time you want to update the ISO data to the latest available version, you can manually re-seed the tables:

Config

Optionally, you can publish the config file with:

In the config you can define, which translations of country/language/currency names you want to store in your DB.

This is the contents of the published config file:

After making changes to the config you need to re-build the database with the following command:

This will create a new SQLITE database and stores it in your project at database/iso-countries.sqlite. Exclude this file from .gitignore to have it available in all environments.

Usage

Country model

Language model

Currency model

Query relationships

All models have pre-defined many-to-many relationships that can be queried:

Localized names

Each of the package models (Country, Language, Currency) has a ->name attribute, which will be displayed in the app's locale, using the spatie/laravel-translatable package. The default config will migrate localized names for en, de, fr, and es. This can be adjusted in the config. The config app.locale and app.fallback_locale are automatically included.

Attribute casting

If you already use ISO codes in your models, you can enrich them by casting them as Country/Language/Currency model:

Testing

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-iso-countries with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^7.0|^8.40|^9.0|^10.0
illuminate/database Version ^7.0|^8.40|^9.0|^10.0
illuminate/support Version ^7.0|^8.40|^9.0|^10.0
spatie/laravel-translatable Version ^4.6|^5.0|^6.0
slowprog/composer-copy-file Version ^0.3
components/flag-icon-css Version ^3.5.0
umpirsky/country-list Version ^2.0.6
umpirsky/language-list Version ^v1.1
umpirsky/currency-list Version ^v1.1.1
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 io238/laravel-iso-countries contains the following files

Loading the files please wait ....