<?php

namespace App\Models;

use App\Models\Traits\Filterable;
use App\Models\Traits\SelectOptions;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UserCategory extends Model
{
  use HasFactory, Filterable, SelectOptions;

  protected $fillable = [
    'user_id',
    'category_id',
    'department_id',
  ];

  public function user()
  {
    return $this->belongsTo(User::class, 'user_id');
  }

  public function category()
  {
    return $this->belongsTo(Category::class, 'category_id');
  }

  public function department()
  {
    return $this->belongsTo(Department::class, 'department_id');
  }
}
