list.blade.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @extends('layouts.admin.app')
  2. @section('content')
  3. <!-- Main content -->
  4. <section class="content">
  5. @include('layouts.errors-and-messages')
  6. <!-- Default box -->
  7. @if($employees)
  8. <div class="box">
  9. <div class="box-body">
  10. <h2>Employees</h2>
  11. <table class="table">
  12. <thead>
  13. <tr>
  14. <td class="col-md-1">ID</td>
  15. <td class="col-md-3">Name</td>
  16. <td class="col-md-3">Email</td>
  17. <td class="col-md-1">Status</td>
  18. <td class="col-md-4">Actions</td>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. @foreach ($employees as $employee)
  23. <tr>
  24. <td>{{ $employee->id }}</td>
  25. <td>{{ $employee->name }}</td>
  26. <td>{{ $employee->email }}</td>
  27. <td>@include('layouts.status', ['status' => $employee->status])</td>
  28. <td>
  29. <form action="{{ route('admin.employees.destroy', $employee->id) }}" method="post" class="form-horizontal">
  30. {{ csrf_field() }}
  31. <input type="hidden" name="_method" value="delete">
  32. <div class="btn-group">
  33. <a href="{{ route('admin.employees.show', $employee->id) }}" class="btn btn-default btn-sm"><i class="fa fa-eye"></i> Show</a>
  34. <a href="{{ route('admin.employees.edit', $employee->id) }}" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i> Edit</a>
  35. <button onclick="return confirm('Are you sure?')" type="submit" class="btn btn-danger btn-sm"><i class="fa fa-times"></i> Delete</button>
  36. </div>
  37. </form>
  38. </td>
  39. </tr>
  40. @endforeach
  41. </tbody>
  42. </table>
  43. {{ $employees->links() }}
  44. </div>
  45. <!-- /.box-body -->
  46. </div>
  47. <!-- /.box -->
  48. @endif
  49. </section>
  50. <!-- /.content -->
  51. @endsection