todo/app/Models/Department.php

29 lines
518 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Department extends Model
{
use HasFactory;
protected $fillable = [
'id',
'name',
'created_by_id',
];
public function users(): HasMany
{
return $this->hasMany(User::class);
}
public function projects(): HasMany
{
return $this->hasMany(Project::class);
}
}