コード例 #1
0
 /**
  * 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']);
 }
コード例 #2
0
 /**
  * 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'));
 }
コード例 #3
0
 /**
  * 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']);
 }