PHPackages                             stylers/laravel-address - 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. stylers/laravel-address

ActiveLibrary

stylers/laravel-address
=======================

Laravel Address Manager

5.0(2y ago)12.4k—0%MITPHPPHP &gt;=8.1CI failing

Since Aug 27Pushed 2y ago5 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (15)Used By (0)

Laravel Address
===============

[](#laravel-address)

[![Latest Stable Version](https://camo.githubusercontent.com/a5c84b78d349749e38fbcb075c09285e61e44fbaab71f7fcb4ada0d7ec1fee44/68747470733a2f2f706f7365722e707567782e6f72672f7374796c6572732f6c61726176656c2d616464726573732f76657273696f6e)](https://packagist.org/packages/stylers/laravel-address)[![Total Downloads](https://camo.githubusercontent.com/ebfc3c05c76799cd16afabd8f62b0a541aa51eccc06f83e2285e782ce3b9c8a3/68747470733a2f2f706f7365722e707567782e6f72672f7374796c6572732f6c61726176656c2d616464726573732f646f776e6c6f616473)](https://packagist.org/packages/stylers/laravel-address)[![License](https://camo.githubusercontent.com/9e521e568961cc84ee3b29fec163009d73a683fc5e0d2b0d818bebf3e9246b62/68747470733a2f2f706f7365722e707567782e6f72672f7374796c6572732f6c61726176656c2d616464726573732f6c6963656e7365)](https://packagist.org/packages/stylers/laravel-address)[![Build Status](https://camo.githubusercontent.com/160c98e17ca37c7ddb37e1a25d2dcb82fc86fb630ab46e18e726685b5d30db7e/68747470733a2f2f7472617669732d63692e6f72672f7374796c6572732d6c6c632f6c61726176656c2d616464726573732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/stylers-llc/laravel-address)[![codecov](https://camo.githubusercontent.com/56a8db893416252381af069d6c5e1ca9b7520897e066f1b6b17e990a294f5432/68747470733a2f2f636f6465636f762e696f2f67682f7374796c6572732d6c6c632f6c61726176656c2d616464726573732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/stylers-llc/laravel-address)[![Maintainability](https://camo.githubusercontent.com/43c671c350c030ae75d3d27deac3cfdc5276a6f97b90dea630774ecf3c453cec/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31363931336632613132663133663739356365612f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/stylers-llc/laravel-address/maintainability)

Laravel version compatibility
-----------------------------

[](#laravel-version-compatibility)

Laravel versionPackage version5.71.05.81.16.01.17.02.08.03.09.04.010.05.0Installation
------------

[](#installation)

```
composer require stylers/laravel-address
```

You can publish the migration

```
php artisan vendor:publish --provider="Stylers\Address\Providers\AddressServiceProvider"
```

After the migration has been published, you can run the migrations

```
php artisan migrate
```

Usage
-----

[](#usage)

```
use Stylers\Address\Contracts\Models\Traits\HasAddressesInterface;
use Stylers\Address\Models\Traits\HasAddresses;

class User extends Authenticatable implements HasAddressesInterface
{
    use Notifiable;
    use HasAddresses;
}
```

Update or Create Address
------------------------

[](#update-or-create-address)

If the `$type` is exists then will be update with `$attributes`.

```
use Stylers\Address\Enums\AddressTypeEnum;

$user = User::first();
$attributes = [
    "country" => "Hungary",
    "zip_code" => "1055",
    "city" => "Budapest",
    "name_of_public_place" => "Kossuth Lajos",
    "type_of_public_place" => "place",
    "number_of_house" => "1-3",
    "floor" => "42",
    "door" => "69",
    "latitude" => "47.5070738",
    "longitude" => "19.045599",
    "parcel_number" => "10086/0/A/3",
]; // array
$type = AddressTypeEnum::PRIMARY; // ?string
$address = $user->updateOrCreateAddress($attributes, $type); // AddressInterface
```

Delete Address
--------------

[](#delete-address)

```
use Stylers\Address\Enums\AddressTypeEnum;

$user = User::first();
$type = AddressTypeEnum::PRIMARY; // ?string
$isDeleted = $user->deleteAddress($type); // boolean
```

Sync Address(es)
----------------

[](#sync-addresses)

The `syncAddresses()` method delete all addressable address if `$type` is not exists in `$arrayOfAttributes[$type][]`. The `syncAddresses()` method create all `$type` of `arrayOfAttributes[$type][]` if type is not exists in `addresses` table.

```
use Stylers\Address\Enums\AddressTypeEnum;

$user = User::first();
$arrayOfAttributes = [
    AddressTypeEnum::MAILING => [
        "country" => "Hungary",
        "zip_code" => "1055",
        "city" => "Budapest",
        "name_of_public_place" => "Kossuth Lajos",
        "type_of_public_place" => "place",
        "number_of_house" => "1-3",
        "floor" => "42",
        "door" => "69",
        "latitude" => "47.5070738",
        "longitude" => "19.045599",
        "parcel_number" => "10086/0/A/3",
    ]
];
$addresses = $user->syncAddresses($arrayOfAttributes); // Collection
```

How to Test
-----------

[](#how-to-test)

```
$ docker run -it --rm -v $PWD:/app -w /app composer bash
$ composer install
$ ./vendor/bin/phpunit
```

### Troubleshooting

[](#troubleshooting)

```
# Fatal error: Allowed memory size of...
$ COMPOSER_MEMORY_LIMIT=-1 composer install
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 54.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 ~217 days

Recently: every ~252 days

Total

10

Last Release

861d ago

Major Versions

0.2.0 → 1.02021-03-12

1.1 → 2.02021-04-01

2.0.1 → 3.02021-04-08

3.0 → 4.02024-01-03

4.0 → 5.02024-01-03

PHP version history (5 changes)0.1.0PHP &gt;=7.1.3

1.1PHP &gt;=7.2.5

3.0PHP &gt;=7.3

4.0PHP &gt;=8.0

5.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/422c56648fe93491b495251f97a0825657459d44fb86b2d2e9a5183d5b0eefe5?d=identicon)[stylers](/maintainers/stylers)

---

Top Contributors

[![t1k3](https://avatars.githubusercontent.com/u/8018130?v=4)](https://github.com/t1k3 "t1k3 (12 commits)")[![balazsbencs](https://avatars.githubusercontent.com/u/69797681?v=4)](https://github.com/balazsbencs "balazsbencs (9 commits)")[![stylers](https://avatars.githubusercontent.com/u/29388728?v=4)](https://github.com/stylers "stylers (1 commits)")

---

Tags

addresslaravellaraveladdressaddressablestylers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stylers-laravel-address/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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