This commit is contained in:
2025-11-03 13:57:50 +05:00
parent 09c0bec901
commit 5f2760713f
9 changed files with 49 additions and 45 deletions

View File

@@ -57,6 +57,6 @@ trait RoleCheckers
*/
public function isSystemUser(): bool
{
return $this->roles->count > 0;
return $this->roles->count() > 0;
}
}

View File

@@ -2,6 +2,8 @@
namespace App\Modules\UserAdjustments\Traits;
use App\Modules\Branch\Models\Branch;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Spatie\Permission\Traits\HasRoles;
/**
@@ -61,4 +63,14 @@ trait UserAdjustments
{
return (string) $this->getOption('passport_id');
}
/**
* Branches associated with user
*
* @return BelongsToMany<Branch>
*/
public function branches(): BelongsToMany
{
return $this->belongsToMany(Branch::class);
}
}