Last active
February 12, 2021 23:42
-
-
Save engelcituk/f4339410ae973395875ff5a1fb97d798 to your computer and use it in GitHub Desktop.
Errores de validacion, laravel, blade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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