sonover / address
This package is abandoned and no longer maintained.
No replacement package was suggested.
There is no license information available for the latest version (0.4) of this package.
Sonover Address Module
0.4
2018-10-13 14:05 UTC
Requires
- php: >=7.0.0
- konekt/concord: ^1.2
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ^3.7
- phpunit/phpunit: ^7.3
This package is auto-updated.
Last update: 2021-07-16 00:33:51 UTC
README
Sonover Address is a Concord module that allows you to store addresses for an entity. Being a Concord module it is intended to be used by Laravel Applications.
Installation
composer require sonover/address
- If concord hasn't been installed yet, install it
- Edit
config/concord.php
and add the address module:
return [ 'modules' => [ Sonover\Address\Providers\ModuleServiceProvider::class ] ];
After this, address should be listed among the concrd modules:
php artisan concord:modules -a
+----+-----------------------+--------+---------+------------------+-----------------+
| # | Name | Kind | Version | Id | Namespace |
+----+-----------------------+--------+---------+------------------+-----------------+
| 1. | Sonover Address Module | Module | 0.2.0 | sonover.address | Sonover\Address |
+----+-----------------------+--------+---------+------------------+-----------------+
Usuage
class Contact extends Model { use Addressable; }
Add an Address
$contact->addAddress([ 'address' => 'Example', 'city' => 'Example City', 'province' => 'St. George', 'country' => 'GD', 'postalcode' => 'GD-142' ], 'shipping');
Get all shipping addresses
$contact->shippingAddress
The following types are supported out of the box: billing
, business
, contract
, mailing
, pickup
, residential
and shipping
If you want to extend this list for your application refer to Extending Enums in Concord's documentation.
You can grab any address by the type $contact->{type}Address
Remove Address
$contact->removeAddress($address)