<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Message extends Model
{
    use HasFactory;
    
    protected $table = 'message';

    protected $fillable = ['chat_id', 'from', 'to', 'message', 'type'];

    public function chat()
    {
        return $this->belongsTo(ChatGroup::class, 'chat_id');
    }
}
