src/Classes/Hook.php
public static function getModulesByName($hook)
    {
        return  \Cache::remember('hook'.$hook,100000,function() use($hook){
            return \DB::table('modules AS m')->select('m.*','hm.position')
                ->leftJoin('hooks_modules AS hm', 'hm.id_module', '=', 'm.id')
                ->leftJoin('hooks AS h', 'h.id', '=', 'hm.id_hook')
                ->where('h.name', $hook)
                ->where('m.active', '1')
                ->orderBy('hm.position', 'ASC')
                ->get();
        });
    }
public static function getModulesByName($hook)
    {
        return  \Cache::remember('hook'.$hook,100000,function() use($hook){
            return \DB::table('modules AS m')->select('m.*','hm.position')
                ->leftJoin('hooks_modules AS hm', 'hm.id_module', '=', 'm.id')
                ->leftJoin('hooks AS h', 'h.id', '=', 'hm.id_hook')
                ->where('h.name', $hook)
                ->where('m.active', '1')
                ->orderBy('hm.position', 'ASC')
                ->get();
        });
    }
public static function getModulesByName ( $ hook ) { return \ Cache :: remember ( 'hook' . $ hook , 100000 , function ( ) use ( $ hook ) { return \ DB :: table ( 'modules AS m' ) -> select ( 'm.*' , 'hm.position' ) -> leftJoin ( 'hooks_modules AS hm' , 'hm.id_module' , '=' , 'm.id' ) -> leftJoin ( 'hooks AS h' , 'h.id' , '=' , 'hm.id_hook' ) -> where ( 'h.name' , $ hook ) -> where ( 'm.active' , '1' ) -> orderBy ( 'hm.position' , 'ASC' ) -> get ( ) ; } ) ; }
get modules by hook order by position asc
@param $hook
@return mixed
get modules by hook order by position asc