I am upgrading Laravel from 5.2 to 5.3. In 5.2, I was throwing Illuminate\Contracts\Validation\ValidationException (using my own validation logic) like so:
$this->errors = new MessageBag();
...
ValidationException($this->errors);
In 5.3, Illuminate\Contracts\Validation\ValidationException is removed. How do I keep the same blade output behaviour? Do I simply recreate ValidationException?
// In blade, this should still print error. (JSON should keep same behaviour too)
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li></li>
@endforeach
</ul>
</div>
@endif
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kd6J8T
via IFTTT
Aucun commentaire:
Enregistrer un commentaire