Download the PHP package wafto/laravel-sepomex without Composer

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

Laravel Sepomex

Total Downloads Latest Stable Version License

Introduction

Laravel Sepomex is a package that provides Mexican postal code (SEPOMEX) lookup functionality for Laravel applications. It imports postal code data from the official "Correos de México" catalog and provides an API to query settlements by postal code or list all states.

Requirements

Installation

Install the package via Composer:

Setup

1. Publish Configuration

Publish the sepomex.php configuration file:

This will create a configuration file at config/sepomex.php where you can customize the table_name and source_file options.

2. Download Source File

Download the official SEPOMEX catalog from Correos de México and save it to your storage directory as cpdescarga.txt.

The file path should match the source_file setting in your configuration.

3. Run Migrations

Run the database migrations to create the required table:

4. Import Data

Import the postal code data using the artisan command:

The --chunk option controls the batch size for database inserts. This process may take several minutes depending on your system.

Usage

Using Dependency Injection (Recommended)

Inject the SepomexContract interface into your controllers or services:

Using the Facade

Alternatively, register the Sepomex facade in config/app.php:

Then use it anywhere in your application:

Using the Container

You can also resolve the contract from the container:

API Methods

Method Description
getByPostal(string $postal) Returns all settlements matching the given postal code
getStates() Returns a list of all Mexican states

Important Notes

The database is distributed by Correos de México with the following clause:

El Catálogo Nacional de Códigos Postales, es elaborado por Correos de México y se proporciona en forma gratuita para uso particular, no estando permitida su comercialización, total o parcial, ni su distribución a terceros bajo ningún concepto.

The database has also been released under the LIBRE USO MX license.

Source

"Catálogo Nacional de Códigos Postales" publicado por Correos de México. Disponible en https://www.correosdemexico.gob.mx/SSLServicios/ConsultaCP/CodigoPostal_Exportar.aspx

License

Laravel Sepomex is open-sourced software licensed under the MIT license.


All versions of laravel-sepomex with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.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 wafto/laravel-sepomex contains the following files

Loading the files please wait ...