php - Laravel 通知类正在通过 Class 'App\Http\Controllers
问题描述
我通过以下方式在 Laravel 上发出了通知:
php artisan notifications:table
php artisan migrate
php artisan make:notification TestNotificationUpdate
表和类创建得很好。
当我使用如下通知时:
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//---- SOME CODE VALIDATION HERE ----
//For testing..
//Notifying my self
auth()->user()->notify( new TestNotificationUpdate() );
//---- SOME CODE STORE DB HERE ----
//---- REDIRECT ----
}
我收到错误:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError(E_ERROR)类'App \ Http \ Controllers \ TestNotificationUpdate'未找到
当然,通知类是 on App\Http\**Notifications**\
。我不确定我错过了什么。我怎样才能解决这个问题?
提前致谢。
解决方案
推荐阅读
- mysql - 如何使用 laravel 查询获取两个日期之间的所有行?
- apache-kafka - 如果我将 log.segment.delete.delay.ms 设置为 0,我可以破坏任何东西吗
- angular - 可以使用 ExcelJS 和 Angular 生成带有多项选择的下拉列表吗?
- vba - 访问 VBA:无法添加没有错误 3211 的新列
- excel - 如果条件为真,则值的总和
- r - 从列表 R 在 lda 函数中插入多个变量
- botframework - 使用 WebChat 时可以在浏览器语音中选择语音吗
- php - 为什么 Outlook 电子邮件将我的电子邮件更改为带有 .dat 扩展名的附件?
- arrays - `PACK` 的 Fortran 多态数组赋值:问题
- python - 如何在views.py中获取Django模型ID