reorganize and cleanup php server code

This commit is contained in:
2026-02-06 13:12:38 +01:00
parent bf2f18f847
commit a6785f26db
3103 changed files with 494 additions and 351462 deletions
@@ -0,0 +1,28 @@
<?php
namespace Vanguard\Support;
trait CanImpersonateUsers
{
/**
* Check if a user can impersonate other users.
*
* @return bool
*/
public function canImpersonate()
{
return $this->hasPermission('users.manage');
}
/**
* Check if a target user can be impersonated.
* By default, all users can be impersonated if a currently logged
* user is not already impersonating another user.
*
* @return bool
*/
public function canBeImpersonated()
{
return ! app('impersonate')->isImpersonating();
}
}