src/Classes/Hook.php
public static function register($hook, $id_module)
    {
        $Hook =  self::isRegistered($hook);
        if (!$Hook)
        {
            // first register hook in database
            $Hook = new Hook();
            $Hook->name = $hook;
            if (!$Hook->save())
            {
                \Log::info($Hook->errors());
                return false;
            }
        }
        return $Hook->registerModule($id_module);

    }
public static function register($hook, $id_module)
    {
        $Hook =  self::isRegistered($hook);
        if (!$Hook)
        {
            // first register hook in database
            $Hook = new Hook();
            $Hook->name = $hook;
            if (!$Hook->save())
            {
                \Log::info($Hook->errors());
                return false;
            }
        }
        return $Hook->registerModule($id_module);

    }
public static function register ( $ hook , $ id_module ) { $ Hook = self :: isRegistered ( $ hook ) ; if ( ! $ Hook ) { // first register hook in database $ Hook = new Hook ( ) ; $ Hook -> name = $ hook ; if ( ! $ Hook -> save ( ) ) { \ Log :: info ( $ Hook -> errors ( ) ) ; return false ; } } return $ Hook -> registerModule ( $ id_module ) ; }
register hook in system
@param $hook
@param $id_module
@return bool
register hook in system