Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/buibr/address

Laravel package for managing addresses on model, morph class for a class, ex. User'
https://github.com/buibr/address

Last synced: 23 days ago
JSON representation

Laravel package for managing addresses on model, morph class for a class, ex. User'

Awesome Lists containing this project

README

        

# buibr/address
Laravel package for managing addresses on model, morph class for a class, ex. User'

### Usage
```php
class User {
use HasAddress;
}

$user = User::first($id);

$user->adresses; // Collection[Address]
$user->addresses() // HasMany

$user->hasAddress() // boolean

$user->addAddress([...]) // AddressInterface

$user->getAddresses(); // Collection[Address]

$user->primaryAddress // Address or null

```