belongsTo(User::class); } public function messages(): HasMany { return $this->hasMany(Message::class)->orderBy('id'); } public function batches(): MorphToMany { return $this->morphToMany(JobBatch::class, 'batchable', relatedPivotKey: 'batch_id')->withPivot('type'); } public function broadcastOn(string $event): array { return [$this, $this->user]; } // public function broadcastWith(string $event): array // { // return ['id' => $this->id, 'title' => $this->title]; // } }