Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @foreach ($array as $row)
- <tr>
- <td>
- <img src="{{ asset('uploads/users/'.$row->login.'/image.png') }}" style="max-width:30px;">
- {{ $row->firstName.' '.$row->lastName }}
- </td>
- <td>
- {{ $row->email }}
- </td>
- <td>
- {{ $row->login }}
- </td>
- <td>
- <!-- Action buttons -->
- <div>
- {!! Form::open(array('route' => array($options['route'].'.destroy', $row->id), 'method' => 'DELETE', 'id' => 'myform')) !!}
- <a href="{{ route($options['route'].'.show', $row->id) }}" class="btn btn-warning btn-sm">
- <i class="la la-small la-edit"></i>
- </a>
- <button type="button" id="delete" class="btn btn-danger btn-sm"><i class="la la-small la-trash"></i></button>
- {!! Form::close() !!}
- </div>
- </td>
- </tr>
- @endforeach
- $('button#delete').on('click', function() {
- swal({
- title: "¿Desea eliminar el usuario?",
- text: "",
- type: "warning",
- showCancelButton: true,
- confirmButtonClass: "btn-danger",
- confirmButtonText: "Si!!",
- cancelButtonText: "No!!",
- closeOnConfirm: false,
- closeOnCancel: false
- },
- function(isConfirm) {
- if (isConfirm) {
- swal({
- title:'¡El usuario será eliminado!',
- text: '',
- type: 'success'
- },
- function() {
- $("#myform").submit();
- });
- } else {
- swal("Cancelled", "El usuario no será eliminado!!", "error");
- }
- });
- })
Add Comment
Please, Sign In to add comment