polishing
linter / quality (push) Failing after 1m2s
tests / ci (8.3) (push) Failing after 47s
tests / ci (8.4) (push) Failing after 1m5s
tests / ci (8.5) (push) Failing after 1m5s

This commit is contained in:
Daan Meijer
2026-06-22 15:21:27 +02:00
parent f3d5be6a80
commit 77c3e34d5b
10 changed files with 52 additions and 10 deletions
+15 -1
View File
@@ -2,6 +2,8 @@
namespace App\Notifications;
use App\Models\Chat;
use App\Models\Message;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use NotificationChannels\WebPush\WebPushChannel;
@@ -36,12 +38,24 @@ class NewActivityNotification extends Notification
*/
public function toWebPush(object $notifiable): WebPushMessage
{
return (new WebPushMessage)
$result = (new WebPushMessage)
->title('New Activity')
->icon('/apple-touch-icon.png')
->body($this->activity['content'])
->action('View', 'view')
->data(['url' => $this->activity['url']]);
switch (get_class($this->activity)) {
case Message::class:
/** @var Chat $chat */
$chat = $this->activity->chat;
$result->data(['url' => $chat->subjectUrl]);
break;
}
return $result;
}
/**