PHPackages                             laravel-enso/addressesmanager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravel-enso/addressesmanager

Abandoned → [laravel-enso/addresses](/?search=laravel-enso%2Faddresses)Library[Utility &amp; Helpers](/categories/utility)

laravel-enso/addressesmanager
=============================

Addresses Manager for Laravel Enso

5.8.9(1mo ago)615.7k41MITPHP

Since Dec 8Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/laravel-enso/addresses)[ Packagist](https://packagist.org/packages/laravel-enso/addressesmanager)[ RSS](/packages/laravel-enso-addressesmanager/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (27)Versions (301)Used By (1)

Addresses
=========

[](#addresses)

[![License](https://camo.githubusercontent.com/317e69c43a41c24c1ef0fe807328e30f3d0995181362a29da03adc8a3b6d1912/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f6164647265737365732f6c6963656e7365)](LICENSE)[![Stable](https://camo.githubusercontent.com/9ee1027a2cce0a2a38c80d97891dc00bd8f9999c716590f790573d1b630d4d04/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f6164647265737365732f76657273696f6e)](https://packagist.org/packages/laravel-enso/addresses)[![Downloads](https://camo.githubusercontent.com/1c7c19a04f6c02b86d617dff700346305c35e6082140f2a6afb3d8e0ce39a641/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f6164647265737365732f646f776e6c6f616473)](https://packagist.org/packages/laravel-enso/addresses)[![PHP](https://camo.githubusercontent.com/da7cf113b588d26fe679dfefe4a15009272ed358ad4e786ad3c78b45faa61d69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d3737376262342e737667)](composer.json)[![Issues](https://camo.githubusercontent.com/d84975f4f5fb2a6648c73f31ff12f3c1a65f33bd4180a4beb2118f1484d4e9b6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c61726176656c2d656e736f2f6164647265737365732e737667)](https://github.com/laravel-enso/addresses/issues)[![Merge Requests](https://camo.githubusercontent.com/0f51984a922a109971b3876cd576140904f8743ea06baa51fddec9291fcc3539/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6c61726176656c2d656e736f2f6164647265737365732e737667)](https://github.com/laravel-enso/addresses/pulls)

Description
-----------

[](#description)

Addresses is Laravel Enso's reusable address management package for attaching one or more addresses to morphable entities.

It covers the full backend flow for storing, editing, localizing, and querying addresses, while also shipping geographic reference data and API endpoints for address forms, selectors, and dependent location lookups.

The package is designed to work inside the Enso ecosystem and pairs naturally with the frontend address components from `@enso-ui/addresses`.

Installation
------------

[](#installation)

This package comes pre-installed in Laravel Enso applications that require address management.

For standalone installation in an Enso-based application:

```
composer require laravel-enso/addresses
```

The package auto-registers its service provider, loads migrations, merges its configuration, and loads its API routes.

Run the migrations after installation:

```
php artisan migrate
```

If you need the publishable assets, the package exposes:

- `php artisan vendor:publish --tag=addresses-factory`
- `php artisan vendor:publish --tag=enso-factories`
- `php artisan vendor:publish --tag=addresses-seeder`
- `php artisan vendor:publish --tag=enso-seeders`
- `php artisan vendor:publish --tag=addresses-config`
- `php artisan vendor:publish --tag=enso-config`

Features
--------

[](#features)

- Attaches addresses to arbitrary models through a polymorphic `addressable` relation.
- Supports one default address, billing flags, and shipping flags.
- Provides dedicated relations for `address()`, `billingAddress()`, `shippingAddresses()`, and `addresses()`.
- Includes geographic models and data for countries, regions, localities, townships, sectors, and postcodes.
- Ships API endpoints for CRUD flows, address form bootstrapping, select options, postcode lookup, and geolocation.
- Generates address labels from structured location data.
- Supports automatic coordinate lookup through Google geocoding.
- Allows single-address or multiple-address scenarios depending on the consuming model behavior.
- Protects addressable model deletion according to the configured `onDelete` strategy.
- Includes factories, migrations, seeders, validation, JSON form templates, and API resources.

Usage
-----

[](#usage)

Add the `Addressable` trait to the model that should own addresses:

```
use Illuminate\Database\Eloquent\Model;
use LaravelEnso\Addresses\Traits\Addressable;

class Company extends Model
{
    use Addressable;
}
```

You can then work with the provided relations:

```
$company->address;
$company->billingAddress;
$company->shippingAddresses;
$company->addresses;
```

Create a new address through the model relationship:

```
$company->addresses()->create([
    'country_id' => 1,
    'region_id' => 10,
    'locality_id' => 25,
    'street' => 'Main Street',
    'number' => '10',
    'postcode' => '123456',
    'is_default' => true,
]);
```

The package also exposes selectable address options and CRUD endpoints that can be consumed by Enso forms and frontend components.

::: warning Note If the consuming model should behave like a single-address owner, trying to create a second address through the package flow will raise a package exception.

Deletion behavior also depends on `enso.addresses.onDelete`: `cascade` removes addresses with the owner, while `restrict` blocks owner deletion when addresses still exist. :::

API
---

[](#api)

### Routes

[](#routes)

All package routes are registered under:

- prefix: `api/core/addresses`
- name prefix: `core.addresses.`
- middleware: `api`, `auth`, `core`

Endpoints:

- `GET /api/core/addresses/localities`
- `GET /api/core/addresses/regions`
- `GET /api/core/addresses/sectors`
- `GET /api/core/addresses`
- `GET /api/core/addresses/create`
- `POST /api/core/addresses`
- `GET /api/core/addresses/options`
- `GET /api/core/addresses/postcode`
- `GET /api/core/addresses/{address}/edit`
- `GET /api/core/addresses/{address}/localize`
- `PATCH /api/core/addresses/{address}`
- `PATCH /api/core/addresses/{address}/coordinates`
- `DELETE /api/core/addresses/{address}`
- `PATCH /api/core/addresses/makeDefault/{address}`
- `PATCH /api/core/addresses/makeBilling/{address}`
- `PATCH /api/core/addresses/makeShipping/{address}`
- `GET /api/core/addresses/{address}`

### Model

[](#model)

`LaravelEnso\Addresses\Models\Address`

Key relationships:

- `country()`
- `region()`
- `locality()`
- `sector()`
- `addressable()`

Useful methods:

- `label()`
- `store()`
- `makeDefault()`
- `makeBilling()`
- `toggleBilling()`
- `toggleShipping()`
- `localize()`
- `shouldBeSingle()`
- `isLocalized()`

Useful scopes:

- `default()`
- `notDefault()`
- `forPerson()`
- `forCompany()`
- `for()`
- `ordered()`

### Trait

[](#trait)

`LaravelEnso\Addresses\Traits\Addressable`

Exposes:

- `address()`
- `billingAddress()`
- `shippingAddresses()`
- `addresses()`

It also hooks into model deletion to enforce the configured address cleanup strategy.

### Configuration

[](#configuration)

Config file:

- `config/enso/addresses.php`

Current package options:

- `onDelete`Controls owner deletion behavior: `cascade` or `restrict`
- `defaultCountryId`Default country used by the package flows

::: tip Tip If you need country-specific behavior or custom address structure, extend the package locally instead of editing vendor code directly. The package was built to allow custom models, requests, form builders, and templates in the host application. :::

Depends On
----------

[](#depends-on)

Required Enso packages:

- [`laravel-enso/core`](https://docs.laravel-enso.com/backend/core.html) [↗](https://github.com/laravel-enso/core)
- [`laravel-enso/countries`](https://docs.laravel-enso.com/backend/countries.html) [↗](https://github.com/laravel-enso/countries)
- [`laravel-enso/enums`](https://docs.laravel-enso.com/backend/enums.html) [↗](https://github.com/laravel-enso/enums)
- [`laravel-enso/forms`](https://docs.laravel-enso.com/backend/forms.html) [↗](https://github.com/laravel-enso/forms)
- [`laravel-enso/google`](https://docs.laravel-enso.com/backend/google.html) [↗](https://github.com/laravel-enso/google)
- [`laravel-enso/helpers`](https://docs.laravel-enso.com/backend/helpers.html) [↗](https://github.com/laravel-enso/helpers)
- [`laravel-enso/migrator`](https://docs.laravel-enso.com/backend/migrator.html) [↗](https://github.com/laravel-enso/migrator)
- [`laravel-enso/rememberable`](https://docs.laravel-enso.com/backend/rememberable.html) [↗](https://github.com/laravel-enso/rememberable)
- [`laravel-enso/select`](https://docs.laravel-enso.com/backend/select.html) [↗](https://github.com/laravel-enso/select)

Companion frontend package:

- [`@enso-ui/addresses`](https://docs.laravel-enso.com/frontend/addresses.html) [↗](https://github.com/enso-ui/addresses)

External service dependency:

- Google geocoding support through [`laravel-enso/google`](https://docs.laravel-enso.com/backend/google.html) [↗](https://github.com/laravel-enso/google) when using address localization

Contributions
-------------

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 57.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

275

Last Release

43d ago

Major Versions

1.0.9 → 2.2.52018-02-15

1.0.10 → 2.2.82018-03-02

2.5.23 → 3.0.02019-03-08

3.4.27 → 4.0.02020-06-30

4.6.21 → 5.0.02022-02-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (330 commits)")[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (142 commits)")[![raftx24](https://avatars.githubusercontent.com/u/10864136?v=4)](https://github.com/raftx24 "raftx24 (40 commits)")[![vmcvlad](https://avatars.githubusercontent.com/u/37445394?v=4)](https://github.com/vmcvlad "vmcvlad (32 commits)")[![GITmanuela](https://avatars.githubusercontent.com/u/44998004?v=4)](https://github.com/GITmanuela "GITmanuela (13 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (9 commits)")[![AbdullahiAbdulkabir](https://avatars.githubusercontent.com/u/33360580?v=4)](https://github.com/AbdullahiAbdulkabir "AbdullahiAbdulkabir (4 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")[![ionutcatalinsandu](https://avatars.githubusercontent.com/u/29945563?v=4)](https://github.com/ionutcatalinsandu "ionutcatalinsandu (1 commits)")[![DevIonut](https://avatars.githubusercontent.com/u/19207797?v=4)](https://github.com/DevIonut "DevIonut (1 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

addresseslaravellaravel-ensolaraveladdresseslaravel-enso

### Embed Badge

![Health badge](/badges/laravel-enso-addressesmanager/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-enso-addressesmanager/health.svg)](https://phpackages.com/packages/laravel-enso-addressesmanager)
```

###  Alternatives

[laravel-enso/localisation

Language and translation management for Laravel Enso

1362.3k11](/packages/laravel-enso-localisation)[laravel-enso/data-import

Excel Importer dependency for Laravel Enso

2043.6k6](/packages/laravel-enso-data-import)[laravel-enso/tutorials

Tutorial management backend for Laravel Enso

1140.4k](/packages/laravel-enso-tutorials)[laravel-enso/core

The backend shell of a Laravel Enso application

3464.9k201](/packages/laravel-enso-core)[laravel-enso/tables

Server-side data tables and export backend for Laravel Enso

63454.7k81](/packages/laravel-enso-tables)[laravel-enso/roles

Role management for Laravel Enso

1044.4k30](/packages/laravel-enso-roles)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
