<?php

namespace App\Models;

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

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

    public function getUser()
    {
        return $this->belongsTo(User::class, 'usuario_id', 'id');
    }
    public function getDepartamentos()
    {
        return $this->hasMany(DepCliente::class,'cliente_id','id');
    }
    public function getDepartamento()
    {
        return $this->hasOne(DepCliente::class,'cliente_id','id');
    }
    
}
