combindma/mailcoach-skeleton
Composer 安装命令:
composer require combindma/mailcoach-skeleton
包简介
A useful package to have user management in your mailcoach project
README 文档
README
About Combind Agency
Combine Agency is a leading web development agency specializing in building innovative and high-performance web applications using modern technologies. Our experienced team of developers, designers, and project managers is dedicated to providing top-notch services tailored to the unique needs of our clients.
If you need assistance with your next project or would like to discuss a custom solution, please feel free to contact us or visit our website for more information about our services. Let's build something amazing together!
Getting Started
Before you begin, make sure you have the Mailcoach package installed and configured in your new Laravel project. You can find the installation instructions here.
Installation
You can install the package via composer:
composer require combindma/mailcoach-skeleton
Update the User model to this:
namespace App\Models; use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Laravel\Sanctum\PersonalAccessToken; use Spatie\Mailcoach\Domain\Settings\Models\MailcoachUser; use Spatie\Mailcoach\Domain\Shared\Traits\UsesMailcoachModels; use Spatie\WelcomeNotification\ReceivesWelcomeNotification; class User extends Authenticatable implements MailcoachUser { use HasApiTokens; use Notifiable; use ReceivesWelcomeNotification; use UsesMailcoachModels; protected $fillable = [ 'name', 'email', 'password', ]; protected $hidden = [ 'password', 'remember_token', ]; protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function personalAccessTokens(): MorphMany { return $this->morphMany(PersonalAccessToken::class, 'tokenable'); } public function canViewMailcoach(): bool { return true; } }
Add this to your file app/providers/AppServiceProvider.php:
use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Combindma\MailcoachSkeleton\Listeners\SetupMailcoach; use Spatie\Mailcoach\Domain\Shared\Events\ServingMailcoach; public function boot(): void { Event::listen( Registered::class, SendEmailVerificationNotification::class, ); Event::listen( ServingMailcoach::class, SetupMailcoach::class, ); RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); }); Route::mailcoach('/app'); }
You must register the routes needed. Add this in your web file:
MailcoachSkeleton::routes('app');
Add these middlewares to boostrap/app:
->withMiddleware(function (Middleware $middleware) { $middleware->redirectGuestsTo(fn () => route('login')); $middleware->redirectUsersTo('/dashboard'); $middleware->throttleApi(); })
You can publish and run Laravel default migrations ('create_users_table', 'create_sessions_table', 'create_password_resets_table', 'create_jobs_table', 'create_failed_jobs_table') with:
php artisan vendor:publish --tag="mailcoach-skeleton-migrations"
php artisan migrate
Optionally, you can publish the views using
php artisan vendor:publish --tag="mailcoach-skeleton-views"
Creating the first user
After that you can create an initial user by executing php artisan mailcoach:make-user. You can use the created user to login at Mailcoach. New user can be made on the users screen in mailcoach.
Registering custom action: wait for a date
You can register our custom action by adding the classname to the mailcoach.automation.flows.actions config key.
[
'actions' => AutomationAction::defaultActions()->merge([
\Combindma\MailcoachSkeleton\Actions\WaitForDateAction::class,
])->toArray(),
]
Credits
License
The MIT License (MIT). Please see License File for more information.
combindma/mailcoach-skeleton 适用场景与选型建议
combindma/mailcoach-skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 352 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「combind」 「mailcoach-skeleton」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 combindma/mailcoach-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 combindma/mailcoach-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 combindma/mailcoach-skeleton 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A streamlined and stylish UI component library for Laravel Blade, crafted with TailwindCSS and AlpineJs for simplicity and elegance.
Easy Flash Messages for a Laravel App
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
统计信息
- 总下载量: 352
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-12