/** * Force SSL if site is configured to and * the connection is not secure. * * @return void */ public function boot() { if ($this->app['config']->get('force_ssl') >= 1) { if (!$this->app['request']->isSecure()) { $uri = str_replace('http:', 'https:', $this->app['request']->getUri()); $redirect = new RedirectResponse($uri); $redirect->setRequest($this->app['request']); $redirect->send(); $this->app->close(); } } }
/** * Redirect current request to new request (sub requests) * * @param string $url Url to redirect to * @param string $message Message to display on redirect. * @param array $type Message type. * @return void */ public function redirect($url, $message = null, $type = 'success') { $redirect = new RedirectResponse($url); $redirect->setRequest($this['request']); if ($message && $this->has('notification')) { $this['notification']->message($message, $type); } $redirect->send(); $this->close(); }