Download the PHP package plin-code/laravel-istat-geography without Composer

On this page you can find all versions of the php package plin-code/laravel-istat-geography. 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-istat-geography

Laravel ISTAT Geography

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package for importing and managing Italian geographical data from ISTAT.

Features

Requirements

Installation

Quick Start

  1. Install the package:

  2. Publish the configuration:

  3. Run migrations:

  4. Import the data:

That's it! You now have all Italian geographical data in your database.

Commands

geography:import

Performs a full import of all geographical data from ISTAT. Use this for the initial data load.

Options

Option Description
--cap Also import postal codes (CAP) after ISTAT data
--cap-only Import only postal codes, skip ISTAT data (requires existing municipalities)
--cap-file=<path> Use a local JSON file for CAP data instead of downloading

Examples

Note: The remote GeoJSON with geometries is ~464MB. Using --cap-file with a preprocessed JSON file (~3MB) is recommended for better performance.

geography:download-cap

Downloads CAP GeoJSON data and saves it locally for offline import. Useful when you want to download once and import multiple times.

After downloading, import with:

geography:update

Incrementally synchronizes your database with the latest ISTAT data. It compares the current ISTAT CSV against your existing records and applies only the differences: new records are added, changed records are updated, and records no longer present in ISTAT are soft-deleted.

Options

Option Description
--dry-run Simulate the update without making any database changes. Shows what would be added, modified, or deleted.
--force Continue execution even if non-critical errors occur (errors are logged as warnings).

Verbosity Levels

Flag Output
(none) Final summary only (e.g. 3 added, 1 modified, 0 deleted)
-v Download progress, list of new/modified/suppressed records, progress bar
-vv Field-level change details (e.g. name: Old Name โ†’ New Name)
-vvv Debug output with timing information for each operation

Examples

All database operations are wrapped in a transaction. If any error occurs (and --force is not set), all changes are automatically rolled back.

Configuration

Publish the configuration file:

The config/istat-geography.php file allows you to customize:

Example Configuration

Models

The package provides three Eloquent models:

Region

Province

Municipality

ISTAT Fields

Each model exposes a static istatFields() method that returns the list of fields managed by ISTAT data. These are the fields that the geography:update command is allowed to overwrite. Any additional fields you add to your extended models will not be touched during updates.

Extending Models

If you want to use the package models in your main project, you can extend them:

Remember to update the models section in the configuration file to point to your custom classes.

Database Structure

Regions

Provinces

Municipalities

Relationships

Replacing Existing Command

If you already have a geography:import command in your project, you can replace it with the package's command:

Testing

Run the test suite:

The package includes:

Test Coverage

Data Sources

ISTAT Data

Geographic data (regions, provinces, municipalities) is sourced from ISTAT (Italian National Institute of Statistics), the official Italian government statistics agency.

Postal Codes (CAP)

Postal code data is sourced from Zornade Data Downloads.

A huge thanks to Zornade for their incredible work in making Italian public data freely available. Their dedication to open data helps developers build better applications for Italian users.

Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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


All versions of laravel-istat-geography with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^12.0 || ^13.0
league/csv Version ^9.24
guzzlehttp/guzzle Version ^7.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 plin-code/laravel-istat-geography contains the following files

Loading the files please wait ...