PHPackages                             ashupp/laravel-addresses - 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. ashupp/laravel-addresses

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

ashupp/laravel-addresses
========================

Rinvex Addresses is a polymorphic Laravel package, for addressbook management. You can add addresses to any eloquent model with ease.

v7.0.3(2y ago)013MITPHPPHP ^8.0.0

Since Apr 7Pushed 10mo agoCompare

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

READMEChangelogDependencies (8)Versions (30)Used By (0)

Rinvex Addresses
================

[](#rinvex-addresses)

⚠️ This package is abandoned and no longer maintained. No replacement package was suggested. ⚠️

👉 If you are interested to step on as the main maintainer of this package, please [reach out to me](https://twitter.com/omranic)!

---

**Rinvex Addresses** is a polymorphic Laravel package, for addressbook management. You can add addresses to any eloquent model with ease.

[![Packagist](https://camo.githubusercontent.com/1aee6d7831885adcb73412a7ce6f7382b4463c994173a537a618b28a245e600f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696e7665782f6c61726176656c2d6164647265737365732e7376673f6c6162656c3d5061636b6167697374267374796c653d666c61742d737175617265)](https://packagist.org/packages/rinvex/laravel-addresses)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3aa752fdb56a95084f25bbdd513993030741326ab4dd92b705d08801b308c9e4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72696e7665782f6c61726176656c2d6164647265737365732e7376673f6c6162656c3d5363727574696e697a6572267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rinvex/laravel-addresses/)[![Travis](https://camo.githubusercontent.com/292532ade8d82e0a9bd9c535b0c9317e1fd664e44f03f671ede83dca545428df/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72696e7665782f6c61726176656c2d6164647265737365732e7376673f6c6162656c3d5472617669734349267374796c653d666c61742d737175617265)](https://travis-ci.org/rinvex/laravel-addresses)[![StyleCI](https://camo.githubusercontent.com/046431f88bf9338b55834b9b49d96ca22ccd12b532975d2023045f3e9762edf6/68747470733a2f2f7374796c6563692e696f2f7265706f732f38373438353037392f736869656c64)](https://styleci.io/repos/87485079)[![License](https://camo.githubusercontent.com/6527fb1d6e794ace77a1befc3b0377365ee4a97198819372a7c0f98230e08973/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72696e7665782f6c61726176656c2d6164647265737365732e7376673f6c6162656c3d4c6963656e7365267374796c653d666c61742d737175617265)](https://github.com/rinvex/laravel-addresses/blob/develop/LICENSE)

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

[](#installation)

1. Install the package via composer:

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

    ```
    php artisan rinvex:publish:addresses
    ```
3. Execute migrations via the following command:

    ```
    php artisan rinvex:migrate:addresses
    ```
4. Done!

Usage
-----

[](#usage)

To add addresses support to your eloquent models simply use `\Rinvex\Addresses\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' => 'Abdelrahman',
    'family_name' => 'Omran',
    'organization' => 'Rinvex',
    'country_code' => 'eg',
    'street' => '56 john doe st.',
    'state' => 'Alexandria',
    'city' => 'Alexandria',
    'postal_code' => '21614',
    'latitude' => '31.2467601',
    'longitude' => '29.9020376',
    'is_primary' => true,
    'is_billing' => true,
    'is_shipping' => true,
]);

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

// Find an existing address
$address = app('rinvex.addresses.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('rinvex.addresses.address')->isPrimary()->get();

// Scope Billing Addresses
$billingAddresses = app('rinvex.addresses.address')->isBilling()->get();

// Scope Shipping Addresses
$shippingAddresses = app('rinvex.addresses.address')->isShipping()->get();

// Scope Addresses in the given country
$egyptianAddresses = app('rinvex.addresses.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)

The following support channels are available at your fingertips:

- [Chat on Slack](https://bit.ly/rinvex-slack)
- [Help on Email](mailto:help@rinvex.com)
- [Follow on Twitter](https://twitter.com/rinvex)

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)
- [Pull Requests](CONTRIBUTING.md#pull-requests)
- [Coding Standards](CONTRIBUTING.md#coding-standards)
- [Feature Requests](CONTRIBUTING.md#feature-requests)
- [Git Flow](CONTRIBUTING.md#git-flow)

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

[](#security-vulnerabilities)

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

About Rinvex
------------

[](#about-rinvex)

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License
-------

[](#license)

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

(c) 2016-2022 Rinvex LLC, Some rights reserved.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 95.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 ~82 days

Recently: every ~113 days

Total

28

Last Release

1093d 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.9.92022-02-16

v6.9.9 → v7.0.02023-03-15

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.9.9PHP ^8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/14e6defec840a21cf81d7e160cc9780ffdf86911c950e5b72101d315b1506745?d=identicon)[ahupp](/maintainers/ahupp)

---

Top Contributors

[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (278 commits)")[![ashupp](https://avatars.githubusercontent.com/u/1867828?v=4)](https://github.com/ashupp "ashupp (8 commits)")[![adrianmejias](https://avatars.githubusercontent.com/u/1440288?v=4)](https://github.com/adrianmejias "adrianmejias (1 commits)")[![Rattone](https://avatars.githubusercontent.com/u/7362607?v=4)](https://github.com/Rattone "Rattone (1 commits)")[![yasirmturk](https://avatars.githubusercontent.com/u/306691?v=4)](https://github.com/yasirmturk "yasirmturk (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![amrography](https://avatars.githubusercontent.com/u/9614340?v=4)](https://github.com/amrography "amrography (1 commits)")

---

Tags

laraveladdresspostalbillingmodeleloquentstatecountrycityaddressablelatitudelongitudeshippingrinvexpolymorphicstreetprimary

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ashupp-laravel-addresses/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[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.5k10](/packages/rinvex-laravel-tenants)

PHPackages © 2026

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