Added sockets for notifications
This commit is contained in:
@@ -34,6 +34,7 @@ class FlightObserver
|
||||
*/
|
||||
public function updated(UserFlight $flight): void
|
||||
{
|
||||
\Log::info('Observer fired for flight ' . $flight->id);
|
||||
$flight->user->calculateAchievements();
|
||||
$this->clearCache($flight);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Events\NotificationCreated;
|
||||
use App\Models\Notification;
|
||||
|
||||
class NotificationObserver
|
||||
{
|
||||
public function created(Notification $notification): void
|
||||
{
|
||||
\Log::info('Notification created: ' . $notification->id);
|
||||
broadcast(new NotificationCreated($notification));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user