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

Abandoned → [rinvex/laravel-addresses](/?search=rinvex%2Flaravel-addresses)ArchivedLibrary[Database &amp; ORM](/categories/database)

rinvex/addresses
================

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

v0.0.5(7y ago)04.2k1MITPHPPHP ^7.1.3

Since Apr 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rinvex/renamed-addresses)[ Packagist](https://packagist.org/packages/rinvex/addresses)[ Docs](https://rinvex.com)[ RSS](/packages/rinvex-addresses/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (10)Versions (7)Used By (0)

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

[](#rinvex-addresses)

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

⚠️ This package is **renamed** and now maintained at **[rinvex/laravel-addresses](https://github.com/rinvex/laravel-addresses)**, author suggests using the new package instead. Old package supportes up to Laravel v5.6, and the new one supports Laravel v5.7+

[![Packagist](https://camo.githubusercontent.com/c74fe69c7fa3f79120a8828573ca157893cdcc6029302ad81631272d49ef4b54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696e7665782f6164647265737365732e7376673f6c6162656c3d5061636b6167697374267374796c653d666c61742d737175617265)](https://packagist.org/packages/rinvex/addresses)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/401d677d96204503523dd718f029659210a21375f15f0fad3287e8813dc6ea80/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72696e7665782f6164647265737365732e7376673f6c6162656c3d5363727574696e697a6572267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rinvex/addresses/)[![Code Climate](https://camo.githubusercontent.com/87799a07c947f4d31f28bd7bb48b673196affdcdf5c5ec5699c487491e5b391e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f72696e7665782f6164647265737365732e7376673f6c6162656c3d436f6465436c696d617465267374796c653d666c61742d737175617265)](https://codeclimate.com/github/rinvex/addresses)[![Travis](https://camo.githubusercontent.com/14b80cf1ccf5de6c284378769647a0c1f726fe7da29aae87ce719364c98665af/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72696e7665782f6164647265737365732e7376673f6c6162656c3d5472617669734349267374796c653d666c61742d737175617265)](https://travis-ci.org/rinvex/addresses)[![StyleCI](https://camo.githubusercontent.com/046431f88bf9338b55834b9b49d96ca22ccd12b532975d2023045f3e9762edf6/68747470733a2f2f7374796c6563692e696f2f7265706f732f38373438353037392f736869656c64)](https://styleci.io/repos/87485079)[![License](https://camo.githubusercontent.com/8314c73d39c2c4d9f6b9f9a294d2c064f70c770266f8813910eb29294dbba320/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72696e7665782f6164647265737365732e7376673f6c6162656c3d4c6963656e7365267374796c653d666c61742d737175617265)](https://github.com/rinvex/addresses/blob/develop/LICENSE)

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

[](#installation)

1. Install the package via composer:

    ```
    composer require rinvex/addresses
    ```
2. Execute migrations via the following command:

    ```
    php artisan rinvex:migrate:addresses

    ```
3. 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](http://chat.rinvex.com)
- [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-2018 Rinvex LLC, Some rights reserved.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

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

Total

5

Last Release

2785d ago

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

v0.0.3PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e54af04bcacb96e00894621335f88df7ed9895b6cc245deffdc9830a21cfe29?d=identicon)[Omranic](/maintainers/Omranic)

---

Top Contributors

[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (134 commits)")

---

Tags

laraveladdresspostalbillingmodeleloquentstatecountrycityaddressablelatitudelongitudeshippingrinvexpolymorphicstreetprimary

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/rinvex-addresses/health.svg)](https://phpackages.com/packages/rinvex-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)
