Added new blade directive moduleIsEnabled
and module_is_enabled
helper function.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
use App\Models\Common\Company;
|
||||
use App\Traits\DateTime;
|
||||
use App\Traits\Sources;
|
||||
use App\Traits\Modules;
|
||||
use App\Utilities\Date;
|
||||
use App\Utilities\Widgets;
|
||||
|
||||
@ -88,6 +89,20 @@ if (! function_exists('company')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('module_is_enabled')) {
|
||||
/**
|
||||
* Check if a module is enabled.
|
||||
*/
|
||||
function module_is_enabled(string $alias): bool
|
||||
{
|
||||
$module = new class() {
|
||||
use Modules;
|
||||
};
|
||||
|
||||
return $module->moduleIsEnabled($alias);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('company_id')) {
|
||||
/**
|
||||
* Get id of current company.
|
||||
|
Reference in New Issue
Block a user