Download the PHP package nakanakaii/countries without Composer

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

Countries

This package is a user-friendly Laravel package that provides a list of countries along with their codes, flags, phone number lengths, and shortcodes. It simplifies the process of accessing country-related information, making it easy for developers to integrate into their applications.

Installation

To install the package, use the following command:

Also, publish the flags to your application's public folder.

Finally, you can import it in your code:

Usage

Get all countries

To retrieve a list of all countries, use the following code:

The all() method returns an array of country objects, each containing the following information:

Get a specific country by name

To find a specific country by its name, use the findByName() method:

The findByName() method accepts the country name as a parameter and returns the country object that matches the provided name.

Get a specific country by code

To find a specific country by its code, use the findByCode() method:

The findByCode() method accepts the country code (ISO 3166-1 alpha-2 code) as a parameter and returns the country object that matches the provided code.

Get a specific country by dial code

To find a specific country by its dial code, use the findByDialCode() method:

The findByDialCode() method accepts the country dial code as a parameter and returns the country object that matches the provided dial code.

Get the validator rules for a country by code

To retrieve the validator rules for a specific country by its code, use the getPhoneValidatorByCode() method:

Get the validator rules for a country by dial code

To retrieve the validator rules for a specific country by its dial code, use the getPhoneValidatorByDialCode() method:

The getPhoneValidatorByDialCode() method accepts the country dial code as a parameter and returns the validator rules for phone numbers in that country.

NOTE: The validator rules returned by the getPhoneValidatorByCode() and getPhoneValidatorByDialCode() methods are in the form of regular expressions that can be used for phone number validation.


Feel free to explore the package and utilize the provided methods according to your application's requirements.

Troubleshooting and Data Correction

If you encounter any issues or have any suggestions or find any incorrect or missing data, please feel free to open an issue on GitHub.


All versions of countries with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.0
illuminate/support Version *
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 nakanakaii/countries contains the following files

Loading the files please wait ....