refactor event

This commit is contained in:
xiaomlove
2024-04-25 02:15:56 +08:00
parent 52c3365873
commit ae29693549
15 changed files with 57 additions and 35 deletions
+4 -3
View File
@@ -7,6 +7,7 @@ use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
@@ -14,16 +15,16 @@ class TorrentUpdated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public int $torrentId;
public ?Model $model = null;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(int $torrentId)
public function __construct(Model $model)
{
$this->torrentId = $torrentId;
$this->model = $model;
}
/**