src/Classes/Hook.php
public static function execute($hook, $params = array())
    {
        $html = '';
        $modules = Hook::getModulesByName($hook);
        if (!$modules || !is_array($modules) || !count($modules))
            return $html;
        else
        {
            foreach ($modules as $module)
            {
                // check module is exists

                if (\File::exists(app_path('Modules/' . $module->author . '/' . $module->name . '/Module.php')))
                {
                    $object = Module::getInstance($module->author, $module->name);
                    if (method_exists($object, 'hook' . ucfirst($hook)))
                    {
                        $html .= $object->{'hook' . ucfirst($hook)}($params);
                    }
                }

            }
        }
        return $html;
    }
public static function execute($hook, $params = array())
    {
        $html = '';
        $modules = Hook::getModulesByName($hook);
        if (!$modules || !is_array($modules) || !count($modules))
            return $html;
        else
        {
            foreach ($modules as $module)
            {
                // check module is exists

                if (\File::exists(app_path('Modules/' . $module->author . '/' . $module->name . '/Module.php')))
                {
                    $object = Module::getInstance($module->author, $module->name);
                    if (method_exists($object, 'hook' . ucfirst($hook)))
                    {
                        $html .= $object->{'hook' . ucfirst($hook)}($params);
                    }
                }

            }
        }
        return $html;
    }
public static function execute ( $ hook , $ params = array ( ) ) { $ html = '' ; $ modules = Hook :: getModulesByName ( $ hook ) ; if ( ! $ modules || ! is_array ( $ modules ) || ! count ( $ modules ) ) return $ html ; else { foreach ( $ modules as $ module ) { // check module is exists if ( \ File :: exists ( app_path ( 'Modules/' . $ module -> author . '/' . $ module -> name . '/Module.php' ) ) ) { $ object = Module :: getInstance ( $ module -> author , $ module -> name ) ; if ( method_exists ( $ object , 'hook' . ucfirst ( $ hook ) ) ) { $ html .= $ object -> { 'hook' . ucfirst ( $ hook ) } ( $ params ) ; } } } } return $ html ; }
execute hook and load module relation to that
@param $hook
@param array $params
@return string html or nothing
execute hook and load module relation to that