This package is abandoned and no longer maintained. The author suggests using the rinvex/laravel-addresses package instead.

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

v0.0.5 2018-09-29 02:02 UTC

This package is auto-updated.

Last update: 2022-02-01 13:09:39 UTC


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, author suggests using the new package instead. Old package supportes up to Laravel v5.6, and the new one supports Laravel v5.7+

Packagist Scrutinizer Code Quality Code Climate Travis StyleCI License


  1. Install the package via composer:

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

    php artisan rinvex:migrate:addresses
  3. Done!


To add addresses support to your eloquent models simply use \Rinvex\Addresses\Traits\Addressable trait.

Manage your addresses

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

// Create a new address
    '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

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

// Update an existing address
    'label' => 'Default Work Address',

// Delete address

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

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

// Get attached addresses query builder

// 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();


Refer to the Changelog for a full history of the project.


The following support channels are available at your fingertips:

Contributing & Protocols

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

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

Security Vulnerabilities

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

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.


This software is released under The MIT License (MIT).

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