• File: Comment.php
  • Full Path: /var/www/ticketapp/app/Comment.php
  • Date Modified: 01/27/2022 9:56 PM
  • File size: 734 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Comment extends Model
{
    use SoftDeletes;

    public $table = 'comments';

    protected $dates = [
        'created_at',
        'updated_at',
        'deleted_at',
    ];

    protected $fillable = [
        'user_id',
        'ticket_id',
        'departments_id',
        'created_at',
        'updated_at',
        'deleted_at',
        'author_name',
        'author_email',
        'comment_text',
    ];

    public function ticket()
    {
        return $this->belongsTo(Ticket::class, 'ticket_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}