PHPackages                             aecor/addressable - 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. aecor/addressable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aecor/addressable
=================

Add multiple addresses for a User

1.0.3(5y ago)01131MITPHPPHP ^7.4|^8.0

Since Nov 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/adhalwala/addressable)[ Packagist](https://packagist.org/packages/aecor/addressable)[ Docs](https://github.com/aecor/addressable)[ RSS](/packages/aecor-addressable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Add multiple addresses for a User
=================================

[](#add-multiple-addresses-for-a-user)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7c86cdf76a8ba3e011db9d425302841b150cc55b1f095ec27e84526290d196cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6165636f722f6164647265737361626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aecor/addressable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/410160945c844808325ee9e6cb82dbd4e317d4d60d07b6db24228ddd3538af8d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6165636f722f6164647265737361626c652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/aecor/addressable/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/80952fa47053924b8a815ef93badf1fa9cecfb02334c2747531bfad9c9f43da0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6165636f722f6164647265737361626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aecor/addressable)

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

[](#installation)

You can install the package via composer:

```
composer require aecor/addressable
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Aecor\Address\AddressServiceProvider" --tag="migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Aecor\Address\AddressServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'table-name' => 'addresses'
];
```

Usage and few examples
----------------------

[](#usage-and-few-examples)

Prepare your model

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Aecor\Address\Traits\HasAddress;

class YourModel extends Model
{
    use HasAddress;
}
```

Get instance of your model

```
$user = \App\Models\User::find(1);
```

Add a single contact

```
$user->addAddress([
    'type' => 'office',
    'unit' => 'A',
    'house_number' => '10',
    'street' => 'Some street',
    'suburb' => 'Some suburb',
    'postcode' => '123',
    'custom_attributes' => [
        'open_at' => '09:00',
        'close_at' => '06:00'
    ],                          // Optional field
    'order_column' => 1         // Optional field
]);
```

All the common fields are available in database given below, additionally you can store your own details as json in 'custom\_attributes' field. All the fields are kept nullable to make it easy implementation.

```
'type'
'unit'
'house_number'
'street'
'suburb'
'postcode'
'city'
'state'
'latitude'
'longitude'
'custom_attributes' // json field to add any additional data
'order_column'
```

Add multiple contacts

```
$user->addManyAddresses([
    [
        'type' => 'home',
        'unit' => 'A',
        'house_number' => '10',
        'street' => 'Some street 1',
        'suburb' => 'Some suburb 1',
        'postcode' => '123',
    ],
    [
        'type' => 'office',
        'unit' => 'B',
        'house_number' => '1',
        'street' => 'Some street 2',
        'suburb' => 'Some suburb 2',
        'postcode' => '456',
    ]
]);
```

Get all contacts

```
$user->addresses;
```

Get contacts with condition

```
$user->addresses()->where('type', 'home')->get();
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Abrar Dhalwala](https://github.com/adhalwala)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~31 days

Total

4

Last Release

1908d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.0.3PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/62330833?v=4)[Abrar Dhalwala](/maintainers/adhalwala)[@adhalwala](https://github.com/adhalwala)

---

Top Contributors

[![adhalwala](https://avatars.githubusercontent.com/u/62330833?v=4)](https://github.com/adhalwala "adhalwala (10 commits)")

---

Tags

addressableaecor

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aecor-addressable/health.svg)

```
[![Health](https://phpackages.com/badges/aecor-addressable/health.svg)](https://phpackages.com/packages/aecor-addressable)
```

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[mauricius/laravel-htmx

Laravel helper library for Htmx

364101.1k1](/packages/mauricius-laravel-htmx)[illuminate/reflection

The Illuminate Reflection package.

361.6M3](/packages/illuminate-reflection)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)

PHPackages © 2026

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