<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;

class Department extends Model
{
    use HasFactory;

    protected $table = "departments";

    protected $fillable = ["name", "code", "location", "user_id", "no_of_folders"];

    protected $casts = [
        'created_at' => 'datetime:d-m-Y',
    ];

    public function folder(){
        return $this->hasMany(Folder::class);
    }

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