feat: Implement read cursor activity tracking and recent activity dashboard with context

This commit is contained in:
Daan Meijer
2026-06-15 23:37:44 +02:00
parent e32fbc10e0
commit f12639fb59
13 changed files with 721 additions and 28 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class ReadCursor extends Model
{
protected $fillable = [
'user_id',
'cursorable_id',
'cursorable_type',
'read_at',
];
protected $casts = [
'read_at' => 'datetime',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function cursorable(): MorphTo
{
return $this->morphTo();
}
}