title: how to send message with abort in Laravel
body: <p>I've got to abort something if signature is not valid and I also would like to send a message to the view that renders it. I remember being able to do something like this in a previous project of mine, a year ago. But now when I try this</p>
  
  <pre><code>    if (!$request-&gt;hasValidSignature()) {
          abort(401, 'Signature is not valid.');
      }
  </code></pre>
  
  <p>I get an error that mentions that $message is not available</p>
  
  <p>this is definition of the abort function, so its clear that it takes the message as input. </p>
  
  <pre><code>public function abort($code, $message = '', array $headers = [])
  {
      if ($code == 404) {
          throw new NotFoundHttpException($message);
      }
  
      throw new HttpException($code, $message, null, $headers);
  }
  </code></pre>
  
  <p>I wonder why do I get this error then:</p>
  
  <pre><code>ErrorException (E_ERROR)
  Undefined variable: message (View: 
  C:\laragon\www\laraone\resources\views\errors\401.blade.php)
  </code></pre>
  
  <p>this is a part of my 401.blade.php that uses that variable...</p>
  
  <pre><code>&lt;div class="content"&gt;
      &lt;div class="title"&gt;401&lt;/div&gt;Unauthorized action, {{ $message }}
  &lt;/div&gt;
  </code></pre>