diff --git a/app/Utilities/helpers.php b/app/Utilities/helpers.php index 249d126e2..b60d6ad20 100644 --- a/app/Utilities/helpers.php +++ b/app/Utilities/helpers.php @@ -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 {