insyaallah revisi done

This commit is contained in:
Jagad R R
2025-01-23 17:46:38 +07:00
parent 6034c331c5
commit 3a01df56e9
32 changed files with 825 additions and 360 deletions
+11 -1
View File
@@ -29,7 +29,7 @@ class Admin extends Authenticatable
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
'username', 'name', 'email', 'password', 'region_id', 'rayon_id', 'phone'
];
/**
@@ -163,6 +163,16 @@ class Admin extends Authenticatable
return $this->hasOne(UserHasCabang::class, 'user_id')->with('cabang.region');
}
public function getRayon()
{
return $this->belongsTo(Rayon::class, 'rayon_id');
}
public function getRegion()
{
return $this->belongsTo(Region::class, 'region_id');
}
public static function getUserByRoleName($roleName)
{
$role = Role::where('name', $roleName)->first();
+2
View File
@@ -14,6 +14,8 @@ class Notifications extends Model
'content',
'is_read',
'type',
'expense_type',
'expense_id',
'created_at',
'updated_at'
];