定制 inmanturbo/contacts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inmanturbo/contacts

最新稳定版本:v2.1.6

Composer 安装命令:

composer require inmanturbo/contacts

包简介

A simple utility package to handle contacts lists in Laravel

README 文档

README

A simple utility package to handle contacts lists in Laravel

Installation

You can install the package via composer:

composer require inmanturbo/laravel-contacts-manager

You can publish and run the migrations with:

php artisan vendor:publish --tag="contacts-manager-migrations"
php artisan migrate

Usage

//Create a contact
Contact::create([
    'first_name' => '...',
    'last_name' => '...',
    'business_name' => '...',
    'address' => '...',
    'zip_code' => '...',
    'country_code' => '...',
    'email' => '...',
    'mobile' => '...',
    'phone' => '...',
    'vat_number' => '...',
    'notes' => '...',
    'type' => '...' // MANDATORY: 'private' or 'business',
]);

//Create a contact list
ContactList::create([
    'user_id' => '1' //desired user id
    'name' => 'this is the list name'
]);

//attach a contact to a list and viceversa

$contact->lists()->attach($listId);
$list->contacts()->attach($contactId);

//fetch contacts from a list

$list->contacts;

//fetch all lists connected to a contact

$contact->lists;

//Contact and ContactList are taggable. Feel free to use tags as you desire in your flow
//Tags are meant to be a flexible way to categorize your model.
$tag = Tag::create(['name' => 'Test tag', 'user_id' => $user->id]);

$contact->tags()->attach($tag->id);

$contactList->tags()->attach($tag->id);

//Retrive taggable elements from a tag

$tag->contacts; //returns a collection of Contacts
$tag->contactLists; //returns a collection of ContactList

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-27