/** * Handle pane for dashboard page. * * @return void */ public function compose() { $pane = $this->widget->make('pane.orchestra'); $posts = Content::post()->publish()->latest(10)->get(); if ($posts->isEmpty()) { return; } $pane->add('story-latest-posts')->attributes(['class' => 'six columns widget'])->title('Latest Post')->content(view('orchestra/story::widgets.latest-posts')->with('posts', $posts)); }
/** * Get widget services by type. * * @param string $type * * @return \Orchestra\Widget\Handler */ public function widget($type) { return $this->widget->make("{$type}.orchestra"); }
/** * View dashboard. * * @param \Orchestra\Contracts\Foundation\Listener\Account\ProfileDashboard $listener * * @return mixed */ public function show(Listener $listener) { $panes = $this->widget->make('pane.orchestra'); return $listener->showDashboard(['panes' => $panes]); }