WuYongJie 9595267ee7
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 导入 Akaunting 初始源码与团队协作规则
2026-07-20 18:20:25 +08:00

54 lines
1.3 KiB
PHP

<?php
namespace App\Notifications\Auth;
use App\Models\Auth\UserInvitation;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class Invitation extends Notification
{
/**
* The password reset token.
*
* @var UserInvitation
*/
public $invitation;
/**
* Create a notification instance.
*
* @param UserInvitation $invitation
*/
public function __construct($invitation)
{
$this->invitation = $invitation;
}
/**
* Get the notification's channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable): MailMessage
{
return (new MailMessage)
->from(config('mail.from.address'), config('mail.from.name'))
->line(trans('auth.invitation.message_1'))
->action(trans('auth.invitation.button'), route('register', $this->invitation->token))
->line(trans('auth.invitation.message_2'));
}
}