Example #1
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $network_id = config('yppmembers.network_id');
     $network = Network::find($network_id);
     $page_title = $network->name;
     $view->with('network', $network);
     $view->with('support_url', config('yppmembers.support_url'));
 }
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $network_id = config('yppmembers.network_id');
     $network = Network::find($network_id);
     $network_sites = $network->sites()->withcontent()->orderBy('name', 'asc')->get();
     $most_used_tags_in_network = Tag::ofNetwork($network->id)->mostUsedInNetwork($network->id)->take(20)->get();
     $most_used_models_in_network = Model::ofNetwork($network->id)->mostUsedInNetwork($network->id)->take(20)->get();
     $view->with('network_sites', $network_sites);
     $view->with('most_used_tags_in_network', $most_used_tags_in_network);
     $view->with('most_used_models_in_network', $most_used_models_in_network);
 }
Example #3
0
 public function __construct()
 {
     $network_id = config('yppmembers.network_id');
     $network = Network::find($network_id);
     if (!$network) {
         echo 'Invalid Network';
         exit;
     }
     $this->network = $network;
     $this->breadcrumbs = new \Creitive\Breadcrumbs\Breadcrumbs();
     $this->breadcrumbs->setListElement('ol');
     $this->breadcrumbs->setDivider(null);
     $this->breadcrumbs->setCssClasses('breadcrumb');
     $this->breadcrumbs->addCrumb($network->name, url());
     $data['breadcrumbs'] = $this->breadcrumbs;
     $data['network'] = $network;
     $data['support_url'] = config('yppmembers.support_url');
     $data['network_sites'] = $network->sites()->withcontent()->orderBy('name', 'asc')->get();
     $data['most_used_tags_in_network'] = Tag::ofNetwork($network->id)->mostUsedInNetwork($network->id)->take(20)->get();
     $data['most_used_models_in_network'] = Model::ofNetwork($network->id)->mostUsedInNetwork($network->id)->take(20)->get();
     $data['show_network_header'] = true;
     $data['piwik_tracker_ids'] = config('yppmembers.use_piwik') && $network->piwik_id != 0 ? [$network->piwik_id] : [];
     $this->data = $data;
 }