'array', 'status' => Status::class, ]; } public function batches(): MorphToMany { return $this->morphToMany(JobBatch::class, 'batchable')->withPivot('type'); } public function chat(): BelongsTo { return $this->belongsTo(Chat::class); } public function broadcastOn(string $event): array { return [$this, $this->chat]; } public function broadcastWith(string $event): array { return ['id' => $this->id, 'from' => $this->from, 'status' => $this->status]; } }