Added new short function..

This commit is contained in:
Cüneyt Şentürk 2024-05-20 18:36:56 +03:00
parent 63c8857141
commit 6faeaf9227
1 changed files with 27 additions and 0 deletions

View File

@ -113,6 +113,26 @@ if (! function_exists('company_id')) {
}
}
if (! function_exists('team')) {
/**
* Get team of current company.
*/
function team()
{
return company()?->team() !== null ? company()?->team() : company()?->owner?->team();
}
}
if (! function_exists('team_id')) {
/**
* Get id of current company team.
*/
function team_id()
{
return team()?->id;
}
}
if (! function_exists('should_queue')) {
/**
* Check if queue is enabled.
@ -332,6 +352,13 @@ if (! function_exists('role_model_class')) {
}
}
if (! function_exists('team_model_class')) {
function team_model_class(): string
{
return config('laratrust.models.team');
}
}
if (! function_exists('search_string_value')) {
function search_string_value(string $name, string $default = '', string $input = ''): string|array
{