1 <?php namespace BookStack\Exceptions;
4 use Illuminate\Contracts\Support\Responsable;
6 class NotifyException extends Exception implements Responsable
9 public $redirectLocation;
12 * NotifyException constructor.
14 public function __construct(string $message, string $redirectLocation = "/")
16 $this->message = $message;
17 $this->redirectLocation = $redirectLocation;
18 parent::__construct();
22 * Send the response for this type of exception.
25 public function toResponse($request)
27 $message = $this->getMessage();
29 if (!empty($message)) {
30 session()->flash('error', $message);
33 return redirect($this->redirectLocation);