Files
movies/app/Models/Comment.php
T
2025-08-07 23:01:58 +03:00

36 lines
635 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Comment extends Model
{
public const TYPE_MOVIE = 'movie';
public const TYPE_SHOW = 'show';
protected $fillable = [
'entity_id',
'entity_type',
'user_id',
'author_name',
'author_avatar',
'author_rating',
'content',
'published_at',
'tmdb_id',
'tmdb_url',
];
protected $dates = [
'published_at',
'created_at',
'updated_at'
];
public function author()
{
return $this->hasOne(User::class, 'id', 'user_id');
}
}