Download the PHP package maxiewright/laravel-tt-addresses without Composer

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

Laravel Trinidad & Tobago Addresses

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A Laravel package providing Trinidad and Tobago administrative divisions and cities/towns/villages for address management. Includes all 15 administrative divisions and 500+ communities.

Features

Requirements

Installation

Install the package via Composer:

Quick Install (Recommended)

Run the install command which will guide you through the setup:

This will:

  1. Publish the configuration file
  2. Publish the migrations
  3. Optionally run the migrations

Manual Installation

If you prefer to install manually:

Seed the Data

After running migrations, seed the divisions and cities:

Or add them to your DatabaseSeeder.php:

CitySeeder resolves each community's division abbreviation against the divisions table when it runs, so division IDs do not have to start at 1. Run DivisionSeeder first; CitySeeder fails with a clear message if a required abbreviation is missing. Both seeders can be run again without creating duplicate rows, and a repeat city seed updates coordinates.

If you extend CitySeeder, keep getCities() protected and return rows with name, division (an abbreviation such as DMN), latitude, and longitude. For example:

The old division_id row format is no longer accepted because it can attach communities to the wrong division after IDs change.

Configuration

The configuration file is located at config/tt-addresses.php:

Usage

Basic Queries

Division Types

The package includes a DivisionType enum with the following values:

Value Label Island
RegionalCorporation Regional Corporation Trinidad
Borough Borough Trinidad
CityCorporation City Corporation Trinidad
Ward Ward Tobago

Adding Addresses to Your Models

Use the HasTrinidadAndTobagoAddress trait on any model that needs Trinidad and Tobago address fields:

Create a migration for your model:

Then use it:

Geolocation Features

The package includes coordinates for cities, enabling location-based queries:

Using with Address Models

Models using HasTrinidadAndTobagoAddress automatically get location methods:

Search Enhancements

The package includes powerful search and autocomplete features designed for high-performance applications:

Autocomplete Search

Popular Cities

Search Radius Filtering

Nearby Location Suggestions

Performance Optimization

Configuration for Search

Update your config/tt-addresses.php for search optimization:

Filament Integration

The models and enums are designed to work seamlessly with FilamentPHP.

Select Fields

Using the Enum in Filters

Administrative Divisions Reference

Abbreviation Name Type
CTT Couva/Tabaquite/Talparo Regional Corporation
DMN Diego Martin Regional Corporation
MRC Mayaro/Rio Claro Regional Corporation
PED Penal/Debe Regional Corporation
PRT Princes Town Regional Corporation
SGE Sangre Grande Regional Corporation
SJL San Juan/Laventille Regional Corporation
SIP Siparia Regional Corporation
TUP Tunapuna/Piarco Regional Corporation
ARI Arima Borough
CHA Chaguanas Borough
PTF Point Fortin Borough
POS Port of Spain City Corporation
SFO San Fernando City Corporation
TOB Tobago Ward

API Reference

Division Model

Attributes

Relationships

Scopes

Methods

Accessors

City Model

Attributes

Relationships

Scopes

Methods

Accessors

HasTrinidadAndTobagoAddress Trait

Relationships

Methods

Accessors

Testing

For a PostgreSQL test run, create a dedicated tt_addresses_package_test database, then run TT_ADDRESSES_TEST_DB=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_USERNAME=root vendor/bin/pest. The test setup drops package test tables in that database between tests.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please see CONTRIBUTING for details.

Adding Missing Cities

If you notice a city/town/village is missing, please submit a pull request with:

  1. The city name (correctly spelled)
  2. The correct division abbreviation (see Administrative Divisions Reference)

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


Made with โค๏ธ for ๐Ÿ‡น๐Ÿ‡น developers.


All versions of laravel-tt-addresses with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.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 maxiewright/laravel-tt-addresses contains the following files

Loading the files please wait ...