File: /var/www/html/owlcrm/app/Models/Comment.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Comment extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'task_id',
'user_id',
'comment',
];
/**
* Relationship with Task.
*/
public function task()
{
return $this->belongsTo(Task::class, 'task_id');
}
/**
* Relationship with User.
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}