+
+ /**
+ * {@inheritdoc}
+ */
+ public function favourites(): MorphMany
+ {
+ return $this->morphMany(Favourite::class, 'favouritable');
+ }
+
+ /**
+ * Check if the entity is a favourite of the current user.
+ */
+ public function isFavourite(): bool
+ {
+ return $this->favourites()
+ ->where('user_id', '=', user()->id)
+ ->exists();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function logDescriptor(): string
+ {
+ return "({$this->id}) {$this->name}";
+ }