feat: media play
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user