/** * Display a management index of existing entries. * * @param DashboardRepositoryInterface $dashboards * @return \Illuminate\Contracts\View\View|mixed */ public function index(DashboardRepositoryInterface $dashboards) { /* @var DashboardInterface $dashboard */ if (!($dashboard = $dashboards->allowed()->first())) { return $this->redirect->to('admin/dashboard/manage'); } return $this->redirect->to('admin/dashboard/view/' . $dashboard->getSlug()); }