index.blade.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @extends('admin.layout.master')
  2. @section('main_content')
  3. @include('admin.layout.nav')
  4. @include('admin.layout.sidebar')
  5. <div class="main-content">
  6. <section class="section">
  7. <div class="section-header justify-content-between">
  8. <h1>Posts</h1>
  9. <div class="ml-auto">
  10. <a href="{{ route('admin_post_create') }}" class="btn btn-primary"><i class="fas fa-plus"></i> Add New</a>
  11. </div>
  12. </div>
  13. <div class="section-body">
  14. <div class="row">
  15. <div class="col-12">
  16. <div class="card">
  17. <div class="card-body">
  18. <div class="table-responsive">
  19. <table class="table table-bordered" id="example1">
  20. <thead>
  21. <tr>
  22. <th>SL</th>
  23. <th>Photo</th>
  24. <th>Title</th>
  25. <th>Category</th>
  26. <th>Action</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. @foreach($posts as $post)
  31. <tr>
  32. <td>{{ $loop->iteration }}</td>
  33. <td>
  34. <img src="{{ asset('uploads/'.$post->photo) }}" alt="" class="w_150">
  35. </td>
  36. <td>{{ $post->title }}</td>
  37. <td>
  38. {{ $post->blog_category->name }}
  39. </td>
  40. <td class="pt_10 pb_10">
  41. <a href="{{ route('admin_post_edit',$post->id) }}" class="btn btn-primary"><i class="fas fa-edit"></i></a>
  42. <a href="{{ route('admin_post_delete',$post->id) }}" class="btn btn-danger" onClick="return confirm('Are you sure?');"><i class="fas fa-trash"></i></a>
  43. </td>
  44. </tr>
  45. @endforeach
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </section>
  55. </div>
  56. @endsection