insyaallah revisi done
This commit is contained in:
+11
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user