Explore/ismail (#5)
Build Docker Image / build-frontend (push) Successful in 42s

Co-authored-by: ISMAIL MASSERAN <topaz@ISMAILs-Macbook.local>
Co-authored-by: ISMAIL MASSERAN <topaz@Mac.dlinkrouter.local>
Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
2026-08-27 10:40:03 +08:00
parent 1f8642e230
commit 46b41331d2
120 changed files with 3111 additions and 198 deletions
+12
View File
@@ -6,9 +6,11 @@ use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Lab404\Impersonate\Models\Impersonate;
class User extends Authenticatable
{
use Impersonate;
use Notifiable;
protected $guard = 'web';
@@ -43,4 +45,14 @@ class User extends Authenticatable
{
return $this->hasOne(Cawangan::class, 'kodcaw', 'cawangan');
}
public function canImpersonate(): bool
{
return in_array($this->roles ?? '', ['admin'], true);
}
public function canBeImpersonated(): bool
{
return ($this->roles ?? '') !== 'admin';
}
}