Example #1
0
 public function register(array $options)
 {
     $options = array_merge(['itemBoxClass' => 'itemBoxClass', 'titleClass' => 'title', 'descriptionClass' => 'description', 'limit' => 6], $options);
     $category = PageCategory::where('type', '=', PageCategory::NEWS)->first();
     $pages = $category->localizedPages()->orderBy('created_at', 'DESC')->limit($options['limit'])->get();
     return View::make('news::widgets.newsBoxList.list', compact('pages', 'options'));
 }
Example #2
0
 public function getPagesByFilterName($filterName)
 {
     $pages = new Collection();
     $category = PageCategory::where('type', '=', PageCategory::PAGE)->first();
     if ($filterName == 'hidden') {
         return $category->pages()->where('visibility', '=', Page::HIDDEN)->get();
     }
     return $pages;
 }
Example #3
0
 public function register(array $options = array())
 {
     $category = PageCategory::where('type', '=', PageCategory::PAGE)->first();
     if (moduleEnabled('i18n')) {
         $pages = $category->pages()->where(function ($query) {
             $query->where('language', '=', Config::get('app.locale'))->orWhere('language', '=', '')->orWhereNull('language');
             $query->where('visibility', '=', Page::VISIBLE);
         })->get();
     } else {
         $pages = $category->pages()->where('visibility', '=', Page::VISIBLE)->get();
     }
     Menu::make($this->menuName, function ($menu) use($pages) {
         $menu->add(trans('front::front.home'), route('home'));
         Event::fire('front::menu.load', array($menu));
         foreach ($pages as $page) {
             $options = array();
             if ($page->type == Page::LINKED) {
                 $options['target'] = '_blank';
             }
             $menu->add($page->title, $page->url)->link->attr($options);
         }
     });
     return Menu::get($this->menuName)->asUl($options['attributes']);
 }
 public function run()
 {
     Eloquent::unguard();
     PageCategory::create(array('name' => 'Portifólio', 'type' => PageCategory::PORTFOLIO, 'created_at' => new DateTime(), 'updated_at' => new DateTime()));
 }
 public function run()
 {
     Eloquent::unguard();
     #DB::table('page_categories')->delete();
     PageCategory::create(array('id' => 1, 'name' => 'Páginas', 'type' => PageCategory::PAGE, 'created_at' => new DateTime(), 'updated_at' => new DateTime()));
 }
Example #6
0
 public function register(array $options)
 {
     $category = PageCategory::where('type', '=', PageCategory::PORTFOLIO)->first();
     $pages = $category->localizedPages()->get();
     return View::make('portfolio::widgets.portfolioBoxList.list', compact('pages', 'options'));
 }
 public function run()
 {
     Eloquent::unguard();
     PageCategory::create(array('name' => 'Notícias', 'type' => PageCategory::NEWS, 'created_at' => new DateTime(), 'updated_at' => new DateTime()));
 }
Example #8
0
 public function getCategory()
 {
     return PageCategory::where('type', '=', PageCategory::NEWS)->first();
 }