toOthers(); }); static::updated(static function ($task) { broadcast(new BookRecommendationUpdated($task))->toOthers(); }); static::deleting(static function ($task) { broadcast(new BookRecommendationDeleted($task))->toOthers(); }); } /** * Get the user that recommended the book. */ public function recommender(): BelongsTo { return $this->belongsTo(User::class, 'recommended_by'); } public function votes(): HasMany { return $this->hasMany(Vote::class); } public function deadlines(): HasMany { return $this->hasMany(Deadline::class); } }