add notifications logic and add support of both JWT and Sanctum

This commit is contained in:
root
2026-03-11 01:20:31 -04:00
parent f6be51576c
commit 182036cc41
141 changed files with 8685 additions and 648 deletions
@@ -0,0 +1,28 @@
<?php
namespace Tests\Unit\Services\Notifications;
use App\Services\Notifications\NotificationTriggerService;
use Illuminate\Support\Facades\Event;
use Tests\TestCase;
class NotificationTriggerServiceTest extends TestCase
{
public function test_trigger_dispatches_event(): void
{
Event::fake();
NotificationTriggerService::trigger('customNotification', ['foo' => 'bar']);
Event::assertDispatched('customNotification');
}
public function test_to_user_dispatches_event(): void
{
Event::fake();
NotificationTriggerService::toUser(5, 'Hello', 'Message');
Event::assertDispatched('customNotification');
}
}