feat: media play

This commit is contained in:
2026-06-01 14:31:14 +03:30
parent 3d0904f630
commit b575b449cb
5 changed files with 141 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class MediaPlay extends Model
{
protected $fillable = ['user_id', 'media_id', 'play_count', 'last_played_at'];
protected $casts = [
'play_count' => 'integer',
'last_played_at' => 'datetime',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function media(): BelongsTo
{
return $this->belongsTo(Media::class);
}
}