<?php

namespace App\Models\Chats;

use App\Models\User;
use App\Support\UuidScopeTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Chat extends Model {
    use UuidScopeTrait, SoftDeletes;

    protected $dates = [
    ];

    protected $fillable = [
        'uuid',
        'manager_id',
        'client_id'
    ];

    protected $hidden = [
        'id'
    ];


    public function manager(): BelongsTo {
        return $this->belongsTo(User::class);
    }

    public function client(): BelongsTo {
        return $this->belongsTo(Client::class);
    }

    public function messages(): HasMany {
        return $this->hasMany(Message::class);
    }





}
