Files
2026-04-18 17:02:56 +02:00

36 lines
651 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class PostComment extends Model
{
use SoftDeletes;
protected $table = 'post_comments';
protected $fillable = [
'post_id',
'user_id',
'body',
'is_highlighted',
];
protected $casts = [
'is_highlighted' => 'boolean',
];
public function post(): BelongsTo
{
return $this->belongsTo(Post::class);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}