This commit is contained in:
2026-02-03 15:31:29 +05:00
commit 326c677e8d
2800 changed files with 1489388 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Models\Concerns;
trait InteractsWithRoles
{
/**
* Check if user is Me :)
*/
public function isMe(): bool
{
return in_array($this->email, [
'nurmuhammet@mail.com',
]);
}
/**
* Check if user is admin
*/
public function isAdmin(): bool
{
if ($this->isMe()) {
return true;
}
return $this->hasRole('admin');
}
/**
* Check if user is manager
*/
public function isManager(): bool
{
return $this->hasRole('manager');
}
/**
* Check if user is entrepreneur
*/
public function isEntrepreneur(): bool
{
return $this->hasRole('vendor');
}
/**
* Check if user is vendor
*/
public function isVendor(): bool
{
return $this->hasRole('vendor');
}
}