- How do I install sokil/php-isocodes-db-only in a Laravel app?
- Install it with Composer alongside the core library using composer require sokil/php-isocodes sokil/php-isocodes-db-only. This package provides the ISO database only, so it is not useful without sokil/php-isocodes. If you need translated values, install sokil/php-isocodes-db-i18n instead.
- What ISO data does sokil/php-isocodes-db-only include?
- It includes ISO 3166-1 countries, ISO 3166-2 subdivisions, ISO 639-3 languages, ISO 4217 currencies, and ISO 15924 scripts. The package contains database definitions only and does not include localized translations. The data is updated monthly, generally on the second day of each month.
- Do I need sokil/php-isocodes if I install sokil/php-isocodes-db-only?
- Yes. sokil/php-isocodes-db-only is a database-only companion package and does not provide the full lookup API by itself. You install it together with sokil/php-isocodes to access the ISO data in your application.
- Does sokil/php-isocodes-db-only support translations or localization?
- No, this package intentionally contains database definitions without i18n values. If you need localized country, language, currency, or script names, use sokil/php-isocodes-db-i18n instead. You can also build your own translation layer if your Laravel app needs a custom localization strategy.
- Can I use sokil/php-isocodes-db-only for Laravel country code validation?
- The package supplies ISO data, but it does not ship Laravel validation rules itself. You can use sokil/php-isocodes to look up valid codes or seed ISO data into your own tables and add custom validation rules. This works well for country, subdivision, currency, language, and script code validation.
- Which Laravel versions can use sokil/php-isocodes-db-only?
- The package is framework-agnostic and does not declare Laravel-specific version constraints. It can be installed in Laravel projects via Composer as a data dependency for sokil/php-isocodes. Your Laravel version needs to support the PHP and Composer requirements of the core library, so check those constraints before upgrading.
- How often is sokil/php-isocodes-db-only updated?
- The ISO database is updated monthly, typically on the second day of the month. The README shows a versioned database snapshot, for example v4.19.0-64-gbd152c00. For more frequent updates, use sokil/php-isocodes without this database package and manage the database update process yourself.
- Is sokil/php-isocodes-db-only suitable for production Laravel APIs?
- Yes, it is suitable for production use when you need lightweight, standardized ISO metadata without translations. Because it is database-only, you should decide whether to query it through sokil/php-isocodes or seed the data into your own Laravel tables. For large subdivision datasets, add indexes and cache frequently requested ISO metadata.
- How do I test Laravel code that uses sokil/php-isocodes-db-only?
- Use known ISO codes from the package fixtures or seed a small subset of records into your test database. Since the data is static, tests can assert against stable country, language, currency, or script codes. Avoid depending on a production database and use Laravel seeders or mocked lookups for repeatable tests.
- What are alternatives to sokil/php-isocodes-db-only for Laravel ISO data?
- Alternatives include sokil/php-isocodes-db-i18n if you need translations, packages such as laravel-countries, or maintaining your own ISO tables seeded from official sources. Laravel does not ship a full ISO country database by default, so most apps need a package or custom data layer. Compare update cadence, localization support, and whether you want database-only data or a complete lookup API.