feat: Realtime Functionality
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-23 17:40:59 +01:00
parent d6ec298e56
commit 5f1e3ee176
20 changed files with 759 additions and 116 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Events\BookRecommendation;
use App\Models\BookRecommendation;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class BookRecommendationUpdated implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*/
public function __construct(
public BookRecommendation $bookRecommendation
)
{
//
}
public function broadcastAs(): string
{
return 'BookRecommendationUpdated';
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
*/
public function broadcastOn(): array
{
return [
new PrivateChannel('BookRecommendation'),
];
}
}