Download the PHP package christianrey/laravel-addressable without Composer

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

laravel-addressable

Polymorphic postal addresses for Eloquent models — purpose roles (main / shipping / tax), a hybrid international schema, local-first geographic resolution from open data, and an optional, cost-aware Google enrichment layer.

Requires: PHP 8.2+ · Laravel 11, 12 or 13.

Install

Publish the config if you want to tweak table names, tiers, pricing or routes:

Addresses & roles

Add the trait to any model:

Each owner holds at most one main, one shipping and one tax address; a single address may carry several roles at once. Assigning a role atomically demotes the previous holder. The schema is hybrid: typed, queryable columns (country_code, postal_code, locality, admin_area, latitude, longitude, …) plus a components JSON blob and a formatted_address.

Local-first geographic data

Resolve country, region/province and postal code from package-owned tables — no API calls, no per-lookup cost. Data comes from open GeoNames dumps (CC-BY 4.0), imported on demand.

It is not Spain-only

The engine works for any country GeoNames covers — you import the ones you need by ISO 3166-1 code:

Each --country=XX downloads and imports that country's regions and postal codes into your local tables (idempotent — safe to re-run). Nothing is bundled in the package; a fresh install starts with empty geo tables until you run this.

Resolving

Coverage & caveats (honest)

Geographic data is provided by GeoNames under the Creative Commons Attribution 4.0 license.

Optional Google enrichment

Disabled by default (the null driver refuses enrichment calls). Enable the driver and only the tiers you want:

Enable the matching Google Cloud APIs: Places API (New) (autocomplete), Geocoding API (geocode), Address Validation API (validate).

A disabled tier (or a missing key) throws a typed exception — TierDisabledException, MissingApiKeyException, QuotaExceededException or MalformedResponseException — so failures are never silent. Set quota caps in Google Cloud Console to keep testing within the free tier.

CLI

Reference prices live in config/addressable.php under geocoding.pricing — editable, with an updated_at per SKU. They are a reference, not a live quote; always confirm against Google's pricing page.

Server-side proxy routes (optional)

Disabled by default. When enabled, your frontend calls these endpoints and the Google API key stays on the server — it is never sent to the browser.

Method & path Body Returns
POST /addressable/autocomplete { "input": "…", "sessionToken"? } { "suggestions": [{ "placeId", "text" }] }
POST /addressable/geocode { "address": "…" } { "result": { …AddressData } \| null }
POST /addressable/validate { "line1": "…", "line2"?, "country_code"? } { "complete": bool, "address": { …AddressData } }

A disabled tier returns 409; quota 429; an unconfigured key 503; any upstream error 502 — all with generic bodies. Google's raw response is never forwarded to the client.

Testing

The Google driver is faked in tests — the suite never makes real network calls.

License

MIT. See LICENSE. Geographic data © GeoNames, CC-BY 4.0.


All versions of laravel-addressable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
spatie/laravel-package-tools Version ^1.16
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 christianrey/laravel-addressable contains the following files

Loading the files please wait ...