我正在尝试从 laravel 8 应用程序发送通知。” 当我点击 URL 时,出现错误。语法错误,意外 ')' 在路由文件中:
Route::get('/twitter', function (){
Notification::route(TwitterChannel::class,'')->notify(new TestNotification());
});
在通知文件中
public function via($notifiable) {
return [TwitterChannel::class];
}
public function toTwitter($notifiable)
{
return new TwitterStatusUpdate('Laravel notifications are awesome!');
}
在 composer.json 文件中
"require": {
"php": "^7.3",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel-notification-channels/twitter": "^5.0",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0"
},
错误页面截图是: 错误页面截图