/**
  * Return the admin login form.
  *
  * @param LoginFormBuilder $form
  * @param Redirector       $redirect
  * @param Repository       $config
  * @param Guard            $auth
  * @return \Illuminate\Http\RedirectResponse|\Symfony\Component\HttpFoundation\Response
  */
 public function login(NavigationCollection $navigation, LoginFormBuilder $form, Redirector $redirect, Repository $config, Guard $auth)
 {
     /**
      * If we're already logged in
      * proceed to the dashboard.
      *
      * Replace this later with a
      * configurable landing page.
      */
     if ($auth->check() && ($home = $navigation->home())) {
         return $redirect->to($config->get($home->getHref()));
     }
     return $form->setOption('redirect', 'admin')->setOption('wrapper_view', 'theme::login')->render();
 }
 /**
  * Add a navigation link.
  *
  * @param NavigationLinkInterface $link
  * @return $this
  */
 public function addNavigationLink(NavigationLinkInterface $link)
 {
     $this->navigation->push($link);
     return $this;
 }
 /**
  * Redirect to the users home page.
  *
  * @param NavigationCollection $navigation
  * @param Redirector           $redirect
  * @return \Illuminate\Http\RedirectResponse
  */
 public function index(NavigationCollection $navigation, Redirector $redirect)
 {
     $home = $navigation->home();
     return $redirect->to($home->getHref());
 }