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
if (!$request->hasValidSignature()) {
abort(401, 'Signature is not valid.');
}
I get an error that mentions that $message is not available
this is definition of the abort function, so its clear that it takes the message as input.
public function abort($code, $message = '', array $headers = [])
{
if ($code == 404) {
throw new NotFoundHttpException($message);
}
throw new HttpException($code, $message, null, $headers);
}
I wonder why do I get this error then:
ErrorException (E_ERROR)
Undefined variable: message (View:
C:\laragon\www\laraone\resources\views\errors\401.blade.php)
this is a part of my 401.blade.php that uses that variable...
<div class="content">
<div class="title">401</div>Unauthorized action,
</div>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire