/** * Apply flash. * * @author Casper Rasmussen <*****@*****.**> * * @param \Symfony\Component\HttpFoundation\RedirectResponse $redirectResponse * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function apply(RedirectResponse &$redirectResponse) { // Apply error flash if (!empty($this->error)) { $redirectResponse->with('error', $this->error); } // Apply success flash if (!empty($this->success)) { $redirectResponse->with('success', $this->success); } // Apply info flash if (!empty($this->info)) { $redirectResponse->with('info', $this->info); } // Apply warning flash if (!empty($this->warning)) { $redirectResponse->with('warning', $this->warning); } return $redirectResponse; }