added media, mutation events, agent instructions
linter / quality (push) Failing after 1m3s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m5s
tests / ci (8.5) (push) Failing after 1m4s

This commit is contained in:
Daan Meijer
2026-06-15 22:30:17 +02:00
parent 1d1ca88aea
commit a1adf1da1c
44 changed files with 2083 additions and 287 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ class MessageSent implements ShouldBroadcast
public function broadcastWith(): array
{
return [
'message' => $this->message->load('user'),
'message' => $this->message->load('user', 'media'),
];
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace App\Events;
use App\Models\Mutation;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class MutationCreated implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*/
public function __construct(public Mutation $mutation)
{
//
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, Channel>
*/
public function broadcastOn(): array
{
$chatId = $this->mutation->ledger->dynamic->chat->id;
return [
new PrivateChannel('chats.'.$chatId),
];
}
public function broadcastWith(): array
{
return [
'mutation' => $this->mutation->load('user', 'ledger', 'media'),
'type' => 'created',
];
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace App\Events;
use App\Models\Mutation;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class MutationUpdated implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*/
public function __construct(public Mutation $mutation)
{
//
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, Channel>
*/
public function broadcastOn(): array
{
$chatId = $this->mutation->ledger->dynamic->chat->id;
return [
new PrivateChannel('chats.'.$chatId),
];
}
public function broadcastWith(): array
{
return [
'mutation' => $this->mutation->load('user', 'ledger', 'media'),
'type' => 'updated',
];
}
}