first commit

This commit is contained in:
Ariyutta
2026-08-07 10:47:09 +07:00
commit 1c094fbe7f
11630 changed files with 1580900 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Auth;
if (! function_exists('isSuperuser')) {
/**
* Check if the current authenticated user has the Superuser role.
*/
function isSuperuser(): bool
{
return Auth::check() && Auth::user()->hasRole('Superuser');
}
}
if (! function_exists('hasRole')) {
/**
* Check if the current authenticated user has the specified role.
*/
function hasRole(string $role): bool
{
return Auth::check() && Auth::user()->hasRole($role);
}
}
if (! function_exists('hasAnyRole')) {
/**
* Check if the current authenticated user has any of the specified roles.
*/
function hasAnyRole(array $roles): bool
{
return Auth::check() && Auth::user()->hasAnyRole($roles);
}
}