feat: add community activity feed and mentions

This commit is contained in:
2026-03-17 18:26:57 +01:00
parent 2728644477
commit 2119741ba7
15 changed files with 1280 additions and 112 deletions

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserMention extends Model
{
protected $table = 'user_mentions';
public $timestamps = false;
protected $fillable = [
'user_id',
'mentioned_user_id',
'artwork_id',
'comment_id',
'created_at',
];
protected $casts = [
'user_id' => 'integer',
'mentioned_user_id' => 'integer',
'artwork_id' => 'integer',
'comment_id' => 'integer',
'created_at' => 'datetime',
];
public function actor(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
public function mentionedUser(): BelongsTo
{
return $this->belongsTo(User::class, 'mentioned_user_id');
}
public function artwork(): BelongsTo
{
return $this->belongsTo(Artwork::class);
}
public function comment(): BelongsTo
{
return $this->belongsTo(ArtworkComment::class, 'comment_id');
}
}