From 617c0111ffbeb61401d931f6bf506c2d851861e1 Mon Sep 17 00:00:00 2001 From: Moamen Eltouny <16774083+MoamenEltouny@users.noreply.github.com> Date: Tue, 12 Sep 2023 08:45:37 +0300 Subject: [PATCH] add helpers loader --- src/Core/ServiceProvider.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Core/ServiceProvider.php b/src/Core/ServiceProvider.php index 25888e7..3fe0ec7 100644 --- a/src/Core/ServiceProvider.php +++ b/src/Core/ServiceProvider.php @@ -24,6 +24,7 @@ public function __construct($app) parent::__construct($app); // Modulator Loaders + $this->loadHelpers(); $this->loadConfig(); $this->loadViews(); $this->loadMigrations(); @@ -31,6 +32,20 @@ public function __construct($app) $this->loadTranslations(); } + /** + * Load Module Helpers. + * + * @return void + */ + protected function loadHelpers() + { + if (!static::$module) return; + + if (file_exists($helpers = module_path(static::$module, 'helpers.php'))) { + require $helpers; + } + } + /** * Load Module Configrations. *