todo/app/Models/Department.php

29 lines
518 B
PHP
Raw Permalink Normal View History

2024-04-27 15:14:20 +03:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
2024-05-23 17:03:12 +03:00
use Illuminate\Database\Eloquent\Relations\HasMany;
2024-04-27 15:14:20 +03:00
class Department extends Model
{
use HasFactory;
protected $fillable = [
'id',
'name',
'created_by_id',
];
2024-05-23 17:03:12 +03:00
public function users(): HasMany
{
return $this->hasMany(User::class);
}
public function projects(): HasMany
{
return $this->hasMany(Project::class);
}
2024-04-27 15:14:20 +03:00
}