PHPackages                             beanbean/contact - 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. beanbean/contact

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

beanbean/contact
================

A package for Laravel for save multiple contact

0.2.0(6y ago)234[2 PRs](https://github.com/toancong/contact/pulls)MITPHPPHP &gt;=7.1

Since Apr 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/toancong/contact)[ Packagist](https://packagist.org/packages/beanbean/contact)[ RSS](/packages/beanbean-contact/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Contact
=======

[](#contact)

[![Build Status](https://camo.githubusercontent.com/8072858c5893a637d617c7aebe2feec032afaa90d57c4c0d29279c700b3497af/68747470733a2f2f7472617669732d63692e636f6d2f746f616e636f6e672f636f6e746163742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/toancong/contact)

Install
-------

[](#install)

```
composer require beanbean/contact

```

Usage
-----

[](#usage)

### This package support for single or multiple contact for an object.

[](#this-package-support-for-single-or-multiple-contact-for-an-object)

Example: Your user can have a main contact, and other contact for billing, and other contact for shipping, and other for secondary contact, ...

### Integrate with your code

[](#integrate-with-your-code)

1. Add trait Contactable in your model

```
// class User
use \Bean\Contact\Traits\Contactable;

```

2. Save a contact which update or create new contact

```
$user->saveContact($name = 'shipping', $contact = [
    'first_name' => 'any',
    'last_name'  => 'any',
    'address'    => 'any',
    'address_2'  => 'any',
    'city'       => 'any',
    'state'      => 'any',
    'postcode'    => 'any',
    'country'    => 'any',
    'phone'      => 'any',
    'fax'        => 'any',
    'email'      => 'any',
]);

```

3. Get contact Has some relationship to populate contact

```
$user->contacts // return all contacts of user by hasMany relationship
$user->contact($name = 'shipping')->first() // return a single shipping contact of user
$user->contact_shipping // return a shipping contact of user by magic method

```

4. json api Register the resource provider into your api config file

```
    'providers' => [
        \Bean\Contact\ApiResourceProvider::class,
    ],

```

```
get contact: GET contacts?filter[object_id]=1&filter[object_type]=User&filter[name]=shipping
see more https://github.com/cloudcreativity/laravel-json-api

```

\*\* Publish migration if you need change somethings

```
php artisan vendor:publish --provider "Bean\Contact\ServiceProvider"

```

Contribute
----------

[](#contribute)

PR are welcome. Please open an issue first and submit PR with a good commit message. Thanks

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2234d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b8c3eac17d8b5e89f42e3b1a9f3770ccb5fc7052b3497cb30ab296aa6ba7184?d=identicon)[toanpc](/maintainers/toanpc)

---

Top Contributors

[![toancong](https://avatars.githubusercontent.com/u/5398771?v=4)](https://github.com/toancong "toancong (5 commits)")

---

Tags

contactslaravelmultiple-contact

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/beanbean-contact/health.svg)

```
[![Health](https://phpackages.com/badges/beanbean-contact/health.svg)](https://phpackages.com/packages/beanbean-contact)
```

###  Alternatives

[magento/magento-composer-installer

Composer installer for Magento modules

7523.3M318](/packages/magento-magento-composer-installer)

PHPackages © 2026

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