You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -102,12 +102,12 @@ class Article extends Model
|
||||
|
||||
public function comments(): HasMany
|
||||
{
|
||||
return $this->hasMany(ArticleComment::class);
|
||||
return $this->hasMany(ArticleComment::class)->defaultBehavior();
|
||||
}
|
||||
|
||||
public function reactions(): HasMany
|
||||
{
|
||||
return $this->hasMany(ArticleReaction::class);
|
||||
return $this->hasMany(ArticleReaction::class)->defaultBehavior();
|
||||
}
|
||||
|
||||
public function user()
|
||||
@@ -115,25 +115,25 @@ class Article extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function tags()
|
||||
public function tags(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||
{
|
||||
return $this->morphToMany(Tag::class, 'taggable');
|
||||
}
|
||||
|
||||
protected function titleColor(): Attribute
|
||||
{
|
||||
return new Attribute(
|
||||
get: fn () => isDarkColor($this->predominant_color) ? '#fff' : '#000',
|
||||
);
|
||||
}
|
||||
// protected function titleColor(): Attribute
|
||||
// {
|
||||
// return new Attribute(
|
||||
// get: fn () => isDarkColor($this->predominant_color) ? '#fff' : '#000',
|
||||
// );
|
||||
// }
|
||||
|
||||
public function createFollowersNotification(): void
|
||||
{
|
||||
$this->user->followers()
|
||||
->with('user:id,username')
|
||||
->each(fn (AuthorNotification $follower) => $follower->user->notify($this->user, NotificationType::ArticlePosted, $this->getNotificationUrl()),
|
||||
);
|
||||
}
|
||||
// public function createFollowersNotification(): void
|
||||
// {
|
||||
// $this->user->followers()
|
||||
// ->with('user:id,username')
|
||||
// ->each(fn (AuthorNotification $follower) => $follower->user->notify($this->user, NotificationType::ArticlePosted, $this->getNotificationUrl()),
|
||||
// );
|
||||
// }
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user