PHPackages                             zoparga/laravel-multi-address - 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. zoparga/laravel-multi-address

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

zoparga/laravel-multi-address
=============================

Add many address to many model with a single trait. E.g.: many shipping address for a customer.

0.2.1(3y ago)090MITPHPPHP ^7.3|^8.0

Since Oct 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/zoparga/laravel-multi-address)[ Packagist](https://packagist.org/packages/zoparga/laravel-multi-address)[ Docs](https://github.com/zoparga/laravel-multi-address)[ GitHub Sponsors](https://github.com/zoparga)[ RSS](/packages/zoparga-laravel-multi-address/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (13)Used By (0)

Add many address to many model with a single trait. E.g.: many shipping address for a customer.
===============================================================================================

[](#add-many-address-to-many-model-with-a-single-trait-eg-many-shipping-address-for-a-customer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d48745f784f38560d6c88a6bf0794c763a5de43672599a86ea3ee2e0d9e6eb64/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6f70617267612f6c61726176656c2d6d756c74692d616464726573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zoparga/laravel-multi-address)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a98b1c52c4531ee858aec34ce18fd78d66d61b38af2cd944e890fba5f018ed38/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7a6f70617267612f6c61726176656c2d6d756c74692d616464726573732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/zoparga/laravel-multi-address/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d4b2dca84d97c308821c91312ceaac666161efe7bbdd5aa1655fb52a9715d21d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7a6f70617267612f6c61726176656c2d6d756c74692d616464726573732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/zoparga/laravel-multi-address/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1a6974943c004d2d6a157b5ab49388bbff3b29360672a43427cbb573bc5a6999/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6f70617267612f6c61726176656c2d6d756c74692d616464726573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zoparga/laravel-multi-address)

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

[](#installation)

You can install the package via composer:

```
composer require zoparga/laravel-multi-address
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="zoparga\MultiAddress\MultiAddressServiceProvider" --tag="multi-address-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="zoparga\MultiAddress\MultiAddressServiceProvider" --tag="laravel-multi-address-config"
```

This is the contents of the published config file:

Usage
-----

[](#usage)

- publish migration file
- migrate
- add trait to model
- use it

Prepare model
-------------

[](#prepare-model)

use zoparga\\MultiAddress\\Traits\\MultiAddresseableTrait;

class {{model}} extends Model { use MultiAddresseableTrait; }

```
$model = \App\Models\Model::find(1);

$model->multiaddresses()->create([
        'type' => 'YOUR VALUE',
        'country' => 'YOUR VALUE',
        'zip' => 'YOUR VALUE',
        'city' => 'YOUR VALUE',
        'street' => 'YOUR VALUE',
        'address_longitude' => 'YOUR VALUE',
        'address_latitude' => 'YOUR VALUE',
]);

$multiAddressId = 1;

$model->updateMultiAddress($multiAddressId, [
        'type' => 'YOUR VALUE',
        'country' => 'YOUR VALUE',
        'zip' => 'YOUR VALUE',
        'city' => 'YOUR VALUE',
        'street' => 'YOUR VALUE',
        'address_longitude' => 'YOUR VALUE',
        'address_latitude' => 'YOUR VALUE',
]);

Get the addresses, order by ID - desc
Or you can limit it here
$model->getLatestMultiAddresses()->get();

Or you can limit it here
$model->getLatestMultiAddresses()->limit(3)->get();

Of course you can get last created address
$model->getLastMultiAddress();
```

Testing
-------

[](#testing)

```
composer test
```

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)

- [Papp Zoltán](https://github.com/zoparga)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~43 days

Recently: every ~119 days

Total

12

Last Release

1183d ago

PHP version history (2 changes)0.1.0PHP ^8.0

0.1.1PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/22a5be5fde39a2a8b568a6b58f19db59352605afe5ba0c7ae42deeb5990d1fb4?d=identicon)[zoparga](/maintainers/zoparga)

---

Top Contributors

[![zoparga](https://avatars.githubusercontent.com/u/15894503?v=4)](https://github.com/zoparga "zoparga (18 commits)")

---

Tags

laravelzopargalaravel-multi-address

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zoparga-laravel-multi-address/health.svg)

```
[![Health](https://phpackages.com/badges/zoparga-laravel-multi-address/health.svg)](https://phpackages.com/packages/zoparga-laravel-multi-address)
```

###  Alternatives

[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[ziming/laravel-scrapingbee

A PHP Laravel Library for ScrapingBee

4310.6k](/packages/ziming-laravel-scrapingbee)

PHPackages © 2026

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