PHPackages                             galadrim/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. galadrim/laravel-addresses

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

galadrim/laravel-addresses
==========================

Simple address and contact management for Laravel 5.

042PHP

Since Oct 13Pushed 3y agoCompare

[ Source](https://github.com/galadrimteam/laravel-addresses)[ Packagist](https://packagist.org/packages/galadrim/laravel-addresses)[ RSS](/packages/galadrim-laravel-addresses/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/c5f9de6429cda95d3b95408074801d7953f390c1ebd26f764f191dbddde0f148/68747470733a2f2f706f7365722e707567782e6f72672f76656e646f637261742f6c61726176656c2d6164647265737365732f762f737461626c65)](https://packagist.org/packages/vendocrat/laravel-addresses)[![Total Downloads](https://camo.githubusercontent.com/90198aa97bdd5810c1bb2728936c0db3f72f4128cdb176126c9700f3dbede09e/68747470733a2f2f706f7365722e707567782e6f72672f76656e646f637261742f6c61726176656c2d6164647265737365732f646f776e6c6f616473)](https://packagist.org/packages/vendocrat/laravel-addresses)[![License](https://camo.githubusercontent.com/c3e6a53e78575e87aa3f87c5e186178f6899f9795ca4822abb6cd2b1c7d05911/68747470733a2f2f706f7365722e707567782e6f72672f76656e646f637261742f6c61726176656c2d6164647265737365732f6c6963656e7365)](https://packagist.org/packages/vendocrat/laravel-addresses)

Laravel Addresses
=================

[](#laravel-addresses)

Simple address and contact management for Laravel 5 with automatical geocoding to add longitude and latitude. Uses the famous [Countries](https://github.com/webpatser/laravel-countries) package by Webpatser.

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

[](#installation)

Require the package from your `composer.json` file

```
"require": {
	"vendocrat/laravel-addresses": "dev-master"
}
```

and run `$ composer update` or both in one with `$ composer require vendocrat/laravel-addresses`.

Next register the following service providers and facades to your `config/app.php` file

```
'providers' => [
    // Illuminate Providers ...
    // App Providers ...
    vendocrat\Addresses\AddressesServiceProvider::class,
    Webpatser\Countries\CountriesServiceProvider::class,
];
```

```
'providers' => [
	// Illuminate Facades ...
    'Address'   => vendocrat\Addresses\Facades\Addresses::class,
    'Countries' => Webpatser\Countries\CountriesFacade::class,
];
```

Configuration &amp; Migration
-----------------------------

[](#configuration--migration)

```
$ php artisan vendor:publish
$ php artisan countries:migration
```

This will create a `config/addresses.php` and the migration files. In the config file you can customize the table names, finally you'll have to run migration like so:

```
$ php artisan migrate
```

Check out [Webpatser\\Countries](https://github.com/webpatser/laravel-countries) readme to see how to seed their countries data to your database.

Usage
-----

[](#usage)

##### Add an Address to a Model

[](#add-an-address-to-a-model)

```
$post = Post::find(1);
$post->addAddress([
    'street'     => '123 Example Drive',
    'city'       => 'Vienna',
    'post_code'  => '1110',
    'country'    => 'AT', // ISO-3166-2 or ISO-3166-3 country code
    'is_primary' => true, // optional flag
]);
```

Alternativly you could do...

```
$address = [
    'street'     => '123 Example Drive',
    'city'       => 'Vienna',
    'post_code'  => '1110',
    'country'    => 'AT', // ISO-3166-2 or ISO-3166-3 country code
    'is_primary' => true, // optional flag
];
$post->addAddress($address);
```

Available attributes are `street`, `city`, `post_code`, `state`, `country`, `state`, `note` (for internal use), `is_primary`, `is_billing` &amp; `is_shipping`. Optionally you could also pass `lng` and `lat`, in case you deactivated the included geocoding functionality and want to add them yourself.

##### Check if Model has an Address

[](#check-if-model-has-an-address)

```
if ( $post->hasAddress() ) {
    // Do something
}
```

##### Get all Addresses for a Model

[](#get-all-addresses-for-a-model)

```
$addresses = $post->addresses()->get();
```

##### Get primary/billing/shipping Addresses

[](#get-primarybillingshipping-addresses)

```
$address = $post->getPrimaryAddress();
$address = $post->getBillingAddress();
$address = $post->getShippingAddress();
```

##### Update an Address for a Model

[](#update-an-address-for-a-model)

```
$address = $post->addresses()->first(); // fetch the address

$post->updateAddress($address, $new_attributes);
```

##### Delete an Address from a Model

[](#delete-an-address-from-a-model)

```
$address = $post->addresses()->first(); // fetch the address

$post->deleteAddress($address); // delete by passing it as argument
```

##### Delete all Addresses from a Model

[](#delete-all-addresses-from-a-model)

```
$post->flushAddresses();
```

License
-------

[](#license)

Licensed under [MIT license](http://opensource.org/licenses/MIT).

Author
------

[](#author)

**Handcrafted with love by [Alexander Manfred Poellmann](http://twitter.com/AMPoellmann) for [vendocrat](https://vendocr.at) in Vienna &amp; Rome.**\# laravel-addresses

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f080fe2479b566f3952215e1b1f89a2b5fbdd9ea12f4e13e32687db4b528aa92?d=identicon)[TomGaladrim](/maintainers/TomGaladrim)

---

Top Contributors

[![ThomasGaladrim](https://avatars.githubusercontent.com/u/103996028?v=4)](https://github.com/ThomasGaladrim "ThomasGaladrim (2 commits)")

### Embed Badge

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

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

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74798.8M1.0k](/packages/symfony-runtime)[haruncpi/laravel-user-activity

Monitor user activity easily!

425183.9k2](/packages/haruncpi-laravel-user-activity)[mattwright/urlresolver

PHP class that attempts to resolve URLs to a final, canonical link.

66183.6k](/packages/mattwright-urlresolver)[nyu8/flarum-email-filter

Filter emails registering your Flarum site with whitelist, blacklist and even regular expressions.

102.3k](/packages/nyu8-flarum-email-filter)

PHPackages © 2026

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