Example #1
0
 public function register()
 {
     // registra o debugbar
     $this->app->register('Barryvdh\\Debugbar\\ServiceProvider');
     // registra os widgets
     Widget::register('mainMenu', __NAMESPACE__ . '\\Widgets\\MainMenu');
     // Compila os sass (somente no ambiente local)
     if (App::environment('local')) {
         $themesPath = public_path() . '/themes';
         foreach (['default', Config::get('site.theme')] as $theme) {
             $themePath = $themesPath . '/' . $theme;
             $sassPath = $themePath . '/assets/scss';
             $cssPath = $themePath . '/assets/css';
             if (file_exists($sassPath)) {
                 if (!is_writable($cssPath)) {
                     throw new \Exception("{$cssPath} is not writable");
                 }
                 if (!file_exists($cssPath)) {
                     throw new \Exception("{$cssPath} not exists");
                 }
                 if (!is_dir($cssPath)) {
                     throw new \Exception("{$cssPath} is not a dir");
                 }
                 SassCompiler::run($sassPath . '/', $cssPath . '/');
             }
         }
     }
 }
Example #2
0
 public function register()
 {
     Widget::register('mainBanner', __NAMESPACE__ . '\\Widgets\\MainBanner');
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('banner', 'images/icon_banner.png'), 'Banner'), route('admin.banner_item.index'));
     });
 }
Example #3
0
 public function register()
 {
     // registra os widgets
     Widget::register('newsBoxList', __NAMESPACE__ . '\\Widgets\\NewsBoxList');
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('news', 'images/icon_news.png'), 'Notícias'), route('admin.news.index'));
     });
 }
Example #4
0
 public function register()
 {
     $this->app->register('Cviebrock\\EloquentSluggable\\SluggableServiceProvider');
     $this->app->register('Codesleeve\\LaravelStapler\\LaravelStaplerServiceProvider');
     Widget::register('specialPage', __NAMESPACE__ . '\\Widgets\\SpecialPage');
     Widget::register('pageList', __NAMESPACE__ . '\\Widgets\\PageList');
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('page', 'images/icon_page.png'), 'Páginas'), route('admin.page.index'));
     });
 }
Example #5
0
 public function register()
 {
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('product', 'images/icon_category.png'), 'Categorias'), route('admin.product_category.index'));
         $menu->add(sprintf($format, moduleAsset('product', 'images/icon_product.png'), 'Produtos'), route('admin.product.index'));
     });
     Event::listen('front::menu.load', function ($menu) {
         $menu->add('Produtos', route('product.index'));
     });
     // registra os widgets
     Widget::register('productCarousel', __NAMESPACE__ . '\\Widgets\\Carousel');
     Widget::register('productBox', __NAMESPACE__ . '\\Widgets\\ProductBox');
     // Using class based composers...
     View::composer('product::partials.categories', __NAMESPACE__ . '\\ViewComposers\\CategoriesComposer');
 }
Example #6
0
 public function register()
 {
     require_once __DIR__ . '/macros/form.php';
     // registra os widgets
     Widget::register('languageMenu', __NAMESPACE__ . '\\Widgets\\LanguageMenu');
 }