33 lines
718 B
PHP
33 lines
718 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class NewsArticleCommentReaction extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $table = 'news_article_comment_reactions';
|
|
|
|
protected $fillable = ['comment_id', 'user_id', 'reaction'];
|
|
|
|
protected $casts = [
|
|
'comment_id' => 'integer',
|
|
'user_id' => 'integer',
|
|
'created_at' => 'datetime',
|
|
];
|
|
|
|
public function comment(): BelongsTo
|
|
{
|
|
return $this->belongsTo(NewsArticleComment::class, 'comment_id');
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
} |