Advertisement
Aufantastik1998

Untitled

Dec 7th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. @extends('layouts.master')
  2. @section('title')
  3. <title>Manajemen Kategori</title>
  4. @endsection
  5. @section('content')
  6. <div class="content-wrapper">
  7. <div class="content-header">
  8. <div class="container-fluid">
  9. <div class="row mb-2">
  10. <div class="col-sm-6">
  11. <h1 class="m-0 text-dark">Manajemen Kategori</h1>
  12. </div>
  13. <div class="col-sm-6">
  14. <ol class="breadcrumb float-sm-right">
  15. <li class="breadcrumb-item"><a href="#">Home</a></li>
  16. <li class="breadcrumb-item active">Kategori</li>
  17. </ol>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <section class="content">
  23. <div class="container-fluid">
  24. <div class="row">
  25. <div class="col-md-4">
  26. @card
  27. @slot('title')
  28. Tambah
  29. @endslot
  30.  
  31. @if (session('error'))
  32. @alert(['type' => 'danger'])
  33. {!! session('error') !!}
  34. @endalert
  35. @endif
  36. <form role="form" action="{{ route('kategori.store') }}" method="POST">
  37. @csrf
  38. <div class="form-group">
  39. <label for="name">Kategori</label>
  40. <input type="text"
  41. name="name"
  42. class="form-control {{ $errors->has('name') ? 'is-invalid':'' }}" id="name" required>
  43. </div>
  44. <div class="form-group">
  45. <label for="description">Deskripsi</label>
  46. <textarea name="description" id="description" cols="5" rows="5" class="form-control {{ $errors->has('description') ? 'is-invalid':'' }}"></textarea>
  47. </div>
  48. @slot('footer')
  49. <div class="card-footer">
  50. <button class="btn btn-primary">Simpan</button>
  51. </div>
  52. </form>
  53. @endslot
  54. @endcard
  55. </div>
  56. <div class="col-md-8">
  57. @card
  58. @slot('title')
  59. List Kategori
  60. @endslot
  61.  
  62. @if (session('success'))
  63. @alert(['type' => 'success'])
  64. {!! session('success') !!}
  65. @endalert
  66. @endif
  67.  
  68. <div class="table-responsive">
  69. <table class="table table-hover">
  70. <thead>
  71. <tr>
  72. <td>#</td>
  73. <td>Kategori</td>
  74. <td>Deskripsi</td>
  75. <td>Aksi</td>
  76. </tr>
  77. </thead>
  78. <tbody>
  79. @php $no = 1; @endphp
  80. @forelse ($categories as $row)
  81. <tr>
  82. <td>{{ $no++ }}</td>
  83. <td>{{ $row->name }}</td>
  84. <td>{{ $row->description }}</td>
  85. <td>
  86. <form action="{{ route('kategori.destroy', $row->id) }}" method="POST">
  87. @csrf
  88. <input type="hidden" name="_method" value="DELETE">
  89. <a href="{{ route('kategori.edit', $row->id) }}" class="btn btn-warning btn-sm"><i class="fa fa-edit"></i></a>
  90. <button class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></button>
  91. </form>
  92. </td>
  93. </tr>
  94. @empty
  95. <tr>
  96. <td colspan="4" class="text-center">Tidak ada data</td>
  97. </tr>
  98. @endforelse
  99. </tbody>
  100. </table>
  101. </div>
  102. @slot('footer')
  103. @endslot
  104. @endcard
  105. </div>
  106. </div>
  107. </div>
  108. </section>
  109. </div>
  110. @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement