Skip to content

Instantly share code, notes, and snippets.

@engelcituk
Last active February 12, 2021 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save engelcituk/f4339410ae973395875ff5a1fb97d798 to your computer and use it in GitHub Desktop.
Save engelcituk/f4339410ae973395875ff5a1fb97d798 to your computer and use it in GitHub Desktop.
Errores de validacion, laravel, blade
En un campo en especifico:
<div class="col-lg-4 col-md-6 col-sm-12">
<div class="form-group">
<label>Nombre*</label>
<input type="hidden" name="id" id="id" value="{{$user->id}}">
<input type="text" class="form-control" id="name" name="name" autocomplete="off" value="{{$user->name}}" >
@if ($errors->has('name'))
<span class="text-danger">{{ $errors->first('name') }}</span>
@endif
</div>
</div>
en un archivo include, ciclo foreach
@if ($errors->any())
<ul class="list-group">
@foreach ($errors->all() as $error)
<li class="list-group-item list-padding-item list-group-item-danger">{{$error}}</li>
@endforeach
</ul>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment