laravel - Laravel - {"exception":"[object] (InvalidArgumentException(code: 0): Driver [bugsnag] is not supported
问题描述
在我的 Laravel-8 应用程序中,我尝试发送多个通知:
可以有一个或多个具有管理员角色的用户。
控制器:
$hrservicesQueries = User::role('Admin')->where('company_id', $userCompany)->get();
foreach ($hrservicesQueries as $hrservicesQuery)
{
$hrservicedetails = [
'sent_to' => $hrservicesQuery->id,
'sent_by' => $employeeId, //$userId,
'subject' => 'Leave Approval for : '.$employeeFirstName,
'greeting' => 'Dear '.$hrservicesQuery->first_name . ' '. $hrservicesQuery->last_name . ',',
'body' => 'Please note that you have a Leave request awaiting your approval (' . $employeeFirstName . ' ' .$employeeLastName. ') ',
'line1' => 'Please note that you have a Leave request awaiting your approval (' . $employeeFirstName . ' ' .$employeeLastName. ') ',
'thanks' => 'Thank you!',
'employee_fullname' => $employeeFirstName. ' ' . $employeeLastName,
'employee_code' => $employeeCode,
'employee_email' => $employeeEmail,
'employee_id' => $employeeId,
'hr_service_fullname' => $hrservicesQuery->first_name . ' '. $hrservicesQuery->last_name,
'actionText' => 'Approve/Reject Leave',
'actionURL' => route('leave.leave_reviews.index_hr'),
'hr_service_email' => $hrservicesQuery->email,
'hr_service_id' => $hrservicesQuery->id,
];
Notification::route('mail', $hrservicedetails['hr_service_email'])
->notify(new \App\Notifications\Leave\LineManagerToHrService($hrservicedetails));
}
通知(LineManagerToHrService):
类 LineManagerToHrService 扩展通知实现 ShouldQueue { 使用 Queueable; 私人 $hrservicedetails;
public function __construct($hrservicedetails)
{
$this->hrservicedetails = $hrservicedetails;
}
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
// return (new MailMessage)
$mail = (new MailMessage)
->subject($this->hrservicedetails['subject'])
->greeting($this->hrservicedetails['greeting'])
->line($this->hrservicedetails['line1'])
->action($this->hrservicedetails['actionText'], $this->hrservicedetails['actionURL'])
->line($this->hrservicedetails['thanks']);
$this->storeNotification($mail,$notifiable);
return $mail;
}
}
我得到了这些错误:
App\Http\Controllers\Leave\LeaveReviewsController->leave_request_approve(Object(Illuminate\Http\Request), '189') #11 C:\xampp\htdocs\myapp\vendor\laravel\framework\src\Illuminate\Notifications\NotificationSender.php(103): Illuminate\Notifications\NotificationSender->sendToNotifiable(Object(Illuminate\Notifications\AnonymousNotifiable), 'c4180551 -29f8-4...', Object(App\Notifications\Leave\LineManagerToHrService), 'mail') #12 C:\xampp\htdocs\myapp\vendor\laravel\framework\src\Illuminate\Support\Traits\Localizable .php(19): Illuminate\Notifications\NotificationSender->Illuminate\Notifications{closure}() #13 C:\xampp\htdocs\myapp\vendor\laravel\framework\src\Illuminate\Notifications\NotificationSender.php(105) : Illuminate\Notifications\NotificationSender->withLocale(NULL, Object(Closure)) #14 C:\xampp\htdocs\myapp\vendor\laravel\framework\src\Illuminate\Notifications\ChannelManager.php(54): Illuminate\Notifications \NotificationSender->sendNow(数组,对象(App\Notifications\Leave\LineManagerToHrService),数组)
当我 dd($hrservicesQueries);
我懂了:
我该如何解决?
谢谢
解决方案
推荐阅读
- python - 我正在使用 Python 中的 Pandas,但我不明白为什么在这个 lambda 表达式上将 'x' 打印为 98
- python - lambda 在弹性搜索中删除早于 x 天的索引
- c++ - 使用 CreateProcess () 和 CreatePipe() 从 cmd.exe 重定向 I/O
- django - RuntimeError: 不允许数据库访问,使用“django_db”标记,或“db”或“transactional_db”fixture 来启用它
- autohotkey - FormatTime 返回今天的日期而不是变量的实际日期
- c# - .NET Core 2.2 Migration Builder 无法删除索引
- openshift - 有没有办法在 OpenShift 中链接两个 Cron 作业
- javascript - Rails:处理由于返回按钮或不完整的程序
- ios - 可以卸载 iOS 应用或删除应用中的配置文件吗?
- python - 如何在 Django 中获取完整的联系表格信息?