Download the PHP package imcity-tech/laravel-geonames without Composer

On this page you can find all versions of the php package imcity-tech/laravel-geonames. 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-geonames

🌎 Laravel Geonames

Currently the work in progress. It will receive updates with possible breaking changes. Not recommended using in production environments yet.

The package allows integrating geonames database with a Laravel application.

🗒️ Description

This package is a fork of nevadskiy/laravel-geonames.

The package is very useful for applications that rely on the geo data.

By default, the package provides 5 tables: continents, countries, divisions, cities and translations and fills them with data from the geonames service.

It also allows to keep the data up-to-date, so the package fetches all daily modifications provided by the geonames service and use them to synchronize your own database.

You can also set up the package to seed only data that belongs to specific countries, disable unneeded tables, set up minimal population filter and use your own custom models.

Translations are powered by the imcity-tech/laravel-translatable.

🔌 Installation

✅ Requirements

🔨 Usage

Default structure and behaviour

It will insert download and insert the geonames dataset into your database.

Note that the insert process may take some time. On average, it is about 15 minutes (without downloading time).

Schedule updates

Add the following code to your console kernel (app/Console/Kernel.php) if you want to receive geonames daily updates.

Note, that time is specified for the UTC timezone, so if you run server on another timezone, you need to convert time according to it.

Configure custom structure

If you want to configure package according to your needs, you need to publish the package configuration first.

Specifying source

You can choose appropriate data source for seeding as one of SOURCE_ALL_COUNTRIES, SOURCE_SINGLE_COUNTRY or SOURCE_ONLY_CITIES.

The default is SOURCE_ALL_COUNTRIES that indicates to fetch data from the allCountries.zip file. It contains all 4 models (continents, countries, divisions and cities). You can configure minimal population.

The SOURCE_SINGLE_COUNTRY source is used to fetch data from country-based files (e.g. US.zip). The continents table will not be seeded with this source. You can specify which country (or countries) you are going to seed specifying countries filter in the geonames configuration file.

The SOURCE_ONLY_CITIES source is used to fetch data from city-based files (e.g. cities500.zip). There is only cities table available with this source type. You can specify minimal population filter to indicate which file it is going to fetch by population. It is also possible to use countries filter to seed cities that belongs only to specific countries.

Specifying filters

By default, there are two filters which you can use to filter data being seeded.

Countries filter

The countries filter is used to filter data that belongs only to specific country (or countries). If the SOURCE_SINGLE_COUNTRY source is specified, this filter will be used to download a country-based data source. The default is * that indicates that all countries are allowed. Multiple countries can be specified as an array of ISO country codes.

Example:

Population filter

The population filter is used to filter cities by the indicated minimal population. If the SOURCE_ONLY_CITIES source is specified, this filter will be used to download a city-based data source. Any value from 0 and higher has be used, but in combination with the SOURCE_ONLY_CITIES source, available values are only 500, 1000, 5000 and 15000.

Example:

Overriding models

Most likely you will need your own models with their own behaviour and relations instead of provided ones by default.

To override them, use models key in the geonames configuration file.

If you are not going to use any model, you can switch the value to false and then corresponding tables will not be migrated at all.

For example, most applications probably will not need continent model.

Overriding migrations

To rename tables or remove unnecessary fields, you can publish migrations and edit them before execution migrations command.

Inserting custom structure

Reinserting dataset

Sometimes you may need to delete all data and reinsert it again. To do it, pass the --reset option to geonames:insert command.

📑 Changelog

Please see CHANGELOG for more information what has changed recently.

☕ Contributing

Please see CONTRIBUTING for more information.

🔓 Security

If you discover any security related issues, please e-mail me instead of using the issue tracker.

📜 License

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


All versions of laravel-geonames with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-zip Version *
ext-json Version *
laravel/framework Version ^9.0
imcity-tech/laravel-translatable Version ^0.8
imcity-tech/laravel-uuid Version ^0.8
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 imcity-tech/laravel-geonames contains the following files

Loading the files please wait ....