tadasei/laravel-contacts
Composer 安装命令:
composer require tadasei/laravel-contacts
包简介
A package that provides stubs for managing contact info associations with models
README 文档
README
This package provides stubs for contacts association (with various contact methods) to Eloquent models.
Features
- Quickly generate contacts migrations, models, factories and enums.
- Customize and extend generated code to fit your project's needs.
- Improve development efficiency by eliminating repetitive tasks.
Installation
You can install the package via Composer by running:
composer require tadasei/laravel-contacts --dev
Publishing contacts handling utilities
To publish contacts handling utilities, use the following command:
php artisan contacts:install
Configuring The Country Model
This package references an App\Models\Country model and requires manual supply of its implementation to add phone code support through a phone_code attribute for the following contact method types:
landlinemobilefax
To use a different model, edit App\Models\ContactMethod and Database\Factories\ContactMethodFactory accordingly.
Configuring Contactable Models
To extend or define which models are considered contactable, edit:
App\Enums\ContactableType: Add your model class names to this enum.Database\Factories\ContactFactory: Customize logic to generate contacts for your specific model types.
This allows full flexibility in defining how your application links contacts to models.
Running migrations
To create the related contacts and contact_methods tables, run the generated migrations using the following command:
php artisan migrate
Usage:
$contact = $customer->contacts()->create([ 'name' => 'John Doe', ]); $contact->contactMethods()->create([ 'type' => 'email', 'value' => 'john@example.com', ]);
Customization
The generated code serves as a starting point. You can customize and extend it according to your project's requirements. Modify the generated utilities as needed.
Contributing
Contributions are welcome! If you have suggestions, bug reports, or feature requests, please open an issue on the GitHub repository.
License
This package is open-source software licensed under the MIT license.
tadasei/laravel-contacts 适用场景与选型建议
tadasei/laravel-contacts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 07 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「backend」 「contact」 「laravel」 「stubs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tadasei/laravel-contacts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tadasei/laravel-contacts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tadasei/laravel-contacts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This bundle offers a simple backend explanation form field (inputType).
Preview of settings in footer of tt_content element in page module.
An interactive tour through the TYPO3 backend.
crud widgets for laravel, to make an admin in few lines of code
Define your own css rule-sets for the TYPO3 CMS backend.
Simple & configurable SilverStripe module to notify admin on contact form submission
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-26