<?php

namespace App\Models;

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

class MensagemChat extends Model
{
    use HasFactory;
    protected $table="mensagenschats";
    
    use SoftDeletes;
    protected $dates = ['deleted_at'];

    public function getDestinatario()
    {
        return $this->hasOne(User::class, 'id', 'user_to');
    }
    public function getOrigem()
    {
        return $this->hasOne(User::class, 'id', 'user_from');
    }
}
