36 lines
613 B
PHP
36 lines
613 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TaskComment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'task_comments';
|
|
|
|
protected $fillable = [
|
|
'task_id',
|
|
'user_id',
|
|
'body',
|
|
'mentioned_user_ids',
|
|
];
|
|
|
|
protected $casts = [
|
|
'mentioned_user_ids' => 'array',
|
|
];
|
|
|
|
public function task()
|
|
{
|
|
return $this->belongsTo(Tasks::class, 'task_id');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|
|
|