Download the PHP package nerdsnipe/laravel-countries without Composer

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

Latest Version on Packagist Total Downloads

A Laravel package for working with countries, states, provinces, and cities. Use this package to easily add a dynamic country, state and cities select element series to your Laravel application. All required data is available in the included JSON files which are imported to your database.

Requirements

Installation

You can install the package via composer:

You publish the package config file.

This will publish the file.

Set the and to reflect where to place script and css elements within your view or layout.

Publish the package's data (json) files.

This will copy the countries.json, states.json, and cities.json files to your storage/app/laravel-countries directory.

Example usage

The component relies on providing the id and name of the select element and has the optional values for country, state and city.

This example sets the name attribute of the component to "location", and passes in the IDs of the selected country, state, and city as props, which will pre-select those options when the component is rendered.

The component will then dynamically update the state and city options based on the selected country and state.

Optionally (very useful for the end-user) you can use select2 and set the styles using the set either (or both) of them to true to enable the search feature and select2 styling.

Note: Based on the setting (above) access the submitted values as:

Use the Facade to get access to the underlying data, remember these are large data-sets

Will return collections as JSON. If you want to use the data you can extract it from the collection

After using the country, state and city dynamic selector the data will also be available in the cache.

TODO

Credits

A special thanks and shout-out to the team at Spatie we appreciate all you do for the Laravel open-source community. You have inspired us to extract useful functionality we have created for internal and client applications and make them available as an open source package. This is the first such package.

License

The Laravel Countries Package is open-sourced software licensed under the MIT license.

Change Log

V1.1

Data available in Countries

Data Available in States

Data available in Cities


All versions of laravel-countries with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^9.19|^10.0
spatie/laravel-package-tools Version ^1.14.0
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 nerdsnipe/laravel-countries contains the following files

Loading the files please wait ....