PHPackages                             customd/laravel-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. [Database &amp; ORM](/categories/database)
4. /
5. customd/laravel-addressable

ActiveLibrary[Database &amp; ORM](/categories/database)

customd/laravel-addressable
===========================

Laravel Addressable is a Laravel package to manage addresses that belong to your models. You can add addresses to any eloquent model with ease.

v7.3.0(1y ago)11.3k1[1 PRs](https://github.com/customd/laravel-addressable/pulls)MITPHPPHP ^8.0.0

Since Apr 7Pushed 1y agoCompare

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

READMEChangelog (5)Dependencies (14)Versions (32)Used By (0)

Custom D Addressable
====================

[](#custom-d-addressable)

**Custom D Addressable** is a Laravel package to manage addresses that belong to your models. You can add addresses to any eloquent model with ease.

[![Packagist](https://camo.githubusercontent.com/9300ccf15e76bde3344768a1e2c07c634fd950587752bba3d234fb9183987722/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f637573746f6d642f6c61726176656c2d6164647265737361626c652e7376673f6c6162656c3d5061636b6167697374267374796c653d666c61742d737175617265)](https://packagist.org/packages/customd/laravel-addressable)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/976fd5cc0dc36f6b49ee0a058f78f5af575584b80fdb33996d7df299f316795f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f637573746f6d642f6c61726176656c2d6164647265737361626c652e7376673f6c6162656c3d5363727574696e697a6572267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/customd/laravel-addressable/)[![Travis](https://camo.githubusercontent.com/b3c78b8c3d070b1a88766e41505deef5c19a07ca15e3810ae22515bb933f17f1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f637573746f6d642f6c61726176656c2d6164647265737361626c652e7376673f6c6162656c3d5472617669734349267374796c653d666c61742d737175617265)](https://travis-ci.org/customd/laravel-addressable)[![StyleCI](https://camo.githubusercontent.com/046431f88bf9338b55834b9b49d96ca22ccd12b532975d2023045f3e9762edf6/68747470733a2f2f7374796c6563692e696f2f7265706f732f38373438353037392f736869656c64)](https://styleci.io/repos/87485079)[![License](https://camo.githubusercontent.com/b213148f5b65cad02d6e51da146ed17bdf9dd40254194dae3da56c5666b55565/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f637573746f6d642f6c61726176656c2d6164647265737361626c652e7376673f6c6162656c3d4c6963656e7365267374796c653d666c61742d737175617265)](https://github.com/customd/laravel-addressable/blob/develop/LICENSE)

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

[](#installation)

1. Install the package via composer:

    ```
    composer require customd/laravel-addresses
    ```
2. Publish resources (migrations and config files):

    ```
    php artisan vendor:publish --provider="CustomD\Addressable\AddressesServiceProvider"
    ```
3. Run migrations:

    ```
    php artisan migrate
    ```
4. Done!

Usage
-----

[](#usage)

To add addresses support to your eloquent models simply use `\CustomD\Addressable\Traits\Addressable` trait.

### Manage your addresses

[](#manage-your-addresses)

```
// Get instance of your model
$user = new \App\Models\User::find(1);

// Create a new address
$user->addresses()->create([
    'label' => 'Default Address',
    'given_name' => 'Jane',
    'family_name' => 'Doe',
    'organization' => 'Custom D',
    'country_code' => 'eg',
    'street' => '56 john doe st.',
    'state' => 'Canterbury',
    'city' => 'Christchurch',
    'postal_code' => '7614',
    'latitude' => '31.2467601',
    'longitude' => '29.9020376',
    'is_primary' => true,
]);

// Create multiple new addresses
$user->addresses()->createMany([
    [...],
    [...],
    [...],
]);

// Find an existing address
$address = app('addressable.address')->find(1);

// Update an existing address
$address->update([
    'label' => 'Default Work Address',
]);

// Delete address
$address->delete();

// Alternative way of address deletion
$user->addresses()->where('id', 123)->first()->delete();
```

### Manage your addressable model

[](#manage-your-addressable-model)

The API is intuitive and very straight forward, so let's give it a quick look:

```
// Get instance of your model
$user = new \App\Models\User::find(1);

// Get attached addresses collection
$user->addresses;

// Get attached addresses query builder
$user->addresses();

// Scope Primary Addresses
$primaryAddresses = app('addressable.address')->isPrimary()->get();

// Scope Addresses in the given country
$egyptianAddresses = app('addressable.address')->inCountry('eg')->get();

// Find all users within 5 kilometers radius from the latitude/longitude 31.2467601/29.9020376
$fiveKmAddresses = \App\Models\User::findByDistance(5, 'kilometers', '31.2467601', '29.9020376')->get();

// Alternative method to find users within certain radius
$user = new \App\Models\User();
$users = $user->lat('31.2467601')->lng('29.9020376')->within(5, 'kilometers')->get();
```

Changelog
---------

[](#changelog)

Refer to the [Changelog](CHANGELOG.md) for a full history of the project.

Support
-------

[](#support)

Please raise a GitHub issue.

Contributing &amp; Protocols
----------------------------

[](#contributing--protocols)

Thank you for considering contributing to this project! The contribution guide can be found in [CONTRIBUTING.md](CONTRIBUTING.md).

Bug reports, feature requests, and pull requests are very welcome.

- [Versioning](CONTRIBUTING.md#versioning)
- [Versioning](CONTRIBUTING.md#commit-notes)
- [Pull Requests](CONTRIBUTING.md#pull-requests)
- [Coding Standards](CONTRIBUTING.md#coding-standards)
- [Feature Requests](CONTRIBUTING.md#feature-requests)

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

[](#security-vulnerabilities)

If you discover a security vulnerability within this project, please send an e-mail to [help@customd.com](help@customd.com). All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

This software is released under [The MIT License (MIT)](LICENSE).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance42

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 94.9% 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 ~98 days

Recently: every ~260 days

Total

30

Last Release

466d ago

Major Versions

v2.1.1 → v3.0.02019-09-22

v3.0.2 → v4.0.02020-03-15

v4.1.0 → v5.0.02020-12-21

v5.0.1 → v6.0.02021-08-22

v6.1.0 → v7.0.02022-03-24

PHP version history (6 changes)v0.0.1PHP ^7.0.0

v0.0.3PHP ^7.1.3

v2.0.0PHP ^7.2.0

v4.0.0PHP ^7.4.0

v5.0.1PHP ^7.4.0 || ^8.0.0

v6.0.0PHP ^8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1369970?v=4)[Custom D](/maintainers/customd)[@customd](https://github.com/customd)

---

Top Contributors

[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (278 commits)")[![phpsa](https://avatars.githubusercontent.com/u/952595?v=4)](https://github.com/phpsa "phpsa (6 commits)")[![craigAtCD](https://avatars.githubusercontent.com/u/152445143?v=4)](https://github.com/craigAtCD "craigAtCD (2 commits)")[![samatcd](https://avatars.githubusercontent.com/u/1476991?v=4)](https://github.com/samatcd "samatcd (2 commits)")[![adrianmejias](https://avatars.githubusercontent.com/u/1440288?v=4)](https://github.com/adrianmejias "adrianmejias (1 commits)")[![yasirmturk](https://avatars.githubusercontent.com/u/306691?v=4)](https://github.com/yasirmturk "yasirmturk (1 commits)")[![amrography](https://avatars.githubusercontent.com/u/9614340?v=4)](https://github.com/amrography "amrography (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![Rattone](https://avatars.githubusercontent.com/u/7362607?v=4)](https://github.com/Rattone "Rattone (1 commits)")

---

Tags

laraveladdresspostalbillingmodeleloquentstatecountrycityaddressablelatitudelongitudeshippingpolymorphicstreetprimary

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[rinvex/laravel-categories

Rinvex Categories is a polymorphic Laravel package, for category management. You can categorize any eloquent model with ease, and utilize the power of Nested Sets, and the awesomeness of Sluggable, and Translatable models out of the box.

470161.6k3](/packages/rinvex-laravel-categories)[rinvex/laravel-tenants

Rinvex Tenants is a contextually intelligent polymorphic Laravel package, for single db multi-tenancy. You can completely isolate tenants data with ease using the same database, with full power and control over what data to be centrally shared, and what to be tenant related and therefore isolated from others.

823.4k10](/packages/rinvex-laravel-tenants)

PHPackages © 2026

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