ADD: model and controller for departmetn, role, users

This commit is contained in:
Sallu9007
2025-01-26 01:04:00 +05:30
parent 54647b58f4
commit 9ad7f0939c
7 changed files with 272 additions and 0 deletions

View File

@@ -21,6 +21,8 @@ class User extends Authenticatable
'name',
'email',
'password',
'role_id',
'department_id',
];
/**
@@ -45,4 +47,15 @@ class User extends Authenticatable
'password' => 'hashed',
];
}
public function role()
{
return $this->belongsTo(Role::class);
}
public function department()
{
return $this->belongsTo(Department::class);
}
}