/** * Run the seeder. */ public function run() { $this->widgets->truncate(); $dashboard = $this->dashboards->findBySlug('welcome'); $widget = $this->widgets->create(['en' => ['title' => 'Recent News', 'description' => 'Recent news from http://pyrocms.com/'], 'extension' => 'anomaly.extension.xml_feed_widget', 'dashboard' => $dashboard]); $this->configuration->purge('anomaly.extension.xml_feed_widget'); $this->configuration->create(['scope' => $widget->getId(), 'key' => 'anomaly.extension.xml_feed_widget::url', 'value' => 'http://www.pyrocms.com/posts/rss.xml']); }
/** * View a dashboard. * * @param DashboardRepositoryInterface $dashboards * @param Guard $guard * @param $dashboard * @return \Illuminate\Contracts\View\View|mixed */ public function view(DashboardRepositoryInterface $dashboards, Guard $guard, $dashboard) { if (!($dashboard = $dashboards->findBySlug($dashboard))) { abort(404); } /* @var UserInterface $user */ $user = $guard->user(); $roles = $dashboard->getAllowedRoles(); if (!$roles->isEmpty() && !$user->hasAnyRole($dashboard->getAllowedRoles())) { abort(403); } $widgets = $dashboard->getWidgets(); return $this->view->make('module::admin/dashboards/dashboard', compact('dashboard', 'widgets')); }
/** * Run the seeder. */ public function run() { $this->dashboards->truncate()->create(['en' => ['name' => 'Welcome', 'description' => 'This is the default dashboard for PyroCMS.'], 'slug' => 'welcome', 'layout' => '24']); }