<?php

namespace App\Models;

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

class Branch extends Model
{
    use HasFactory, SoftDeletes;
    protected $table = "branches";

    protected $fillable  = [
        'id',
        'title',
        'department',
        'brand_id',
        'entity_status',
    ];

    protected $hidden = [
        'updated_at',
        'deleted_at',
        'created_by',
        'updated_by',
        'deleted_by',
    ];

    public function users()
    {
        return $this->hasOne(User::class);
    }

    public function brand()
    {
        return $this->belongsTo(Brand::class);
    }
}
