Download the PHP package limanweb/iso-codes without Composer
On this page you can find all versions of the php package limanweb/iso-codes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package iso-codes
limanweb/iso-codes
This package provides any ISO-code lists to use in your Laravel-application.
List of sections and available locales:
- iso_country - ISO 3166-1 country codes;
- locales:
en,fr,ru,ka,hy
- locales:
- iso_currency - ISO 4217 currency codes;
- locales:
en,ru,ka
- locales:
Installation
Run command:
Add service provider class to provider section of your config/app.php
Add alias for facade to alias section of your config/app.php
Run command:
and input index number of Limanweb\IsoCodes\Providers\IsoCodesServiceProvider provider.
Using
Service Limanweb\IsoCodes\Service\IsoCodesService provides a method get() to get any data.
You can access to service throught facade alias \IsoCodes
Syntax:
Arguments:
- $section - section name. Argument is required.
- $path - dot-path to filter result. Argument is not required.
- $locale - locale name. Argument is not required. By default is current application locale.
Examples
To get full country list put iso_country section name into first argument
To get one country item you can put second argument
By default title translates to current application locale. Use third argument to get data in other locale (if it available).
To get full currency list put iso_currency section name into first argument
Features of the implementation
Service class is singleton and has only one instance in application.
Service use two level cache to store compiled (translated) data. First level (L1) cache is a service class property with one request processing lifetime. And second level (L2) cache is a system cache.
You can disable using of cache with use_cache and use_local_cache options in config/limanweb/iso_codes/config.php.
Set use_cache to false for disable using of system cache (L2).
Set use_local_cache to false for disable using of local cache (L1).