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

Co-authored-by: ISMAIL MASSERAN <topaz@ISMAILs-Macbook.local>
Co-authored-by: ISMAIL MASSERAN <topaz@Mac.dlinkrouter.local>
Reviewed-on: #10
This commit was merged in pull request #10.
This commit is contained in:
2026-09-01 10:34:12 +08:00
parent 1f8642e230
commit 21b81d4d51
123 changed files with 3155 additions and 248 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';
}
}