list.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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(!$brands->isEmpty())
  8. <div class="box">
  9. <div class="box-body">
  10. <h2>Brands</h2>
  11. <table class="table">
  12. <thead>
  13. <tr>
  14. <td>Name</td>
  15. <td>Actions</td>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. @foreach ($brands as $brand)
  20. <tr>
  21. <td>
  22. <a href="{{ route('admin.brands.show', $brand->id) }}">{{ $brand->name }}</a>
  23. </td>
  24. <td>
  25. <form action="{{ route('admin.brands.destroy', $brand->id) }}" method="post" class="form-horizontal">
  26. {{ csrf_field() }}
  27. <input type="hidden" name="_method" value="delete">
  28. <div class="btn-group">
  29. <a href="{{ route('admin.brands.edit', $brand->id) }}" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i> Edit</a>
  30. <button onclick="return confirm('Are you sure?')" type="submit" class="btn btn-danger btn-sm"><i class="fa fa-times"></i> Delete</button>
  31. </div>
  32. </form>
  33. </td>
  34. </tr>
  35. @endforeach
  36. </tbody>
  37. </table>
  38. {{ $brands->links() }}
  39. </div>
  40. <!-- /.box-body -->
  41. </div>
  42. <!-- /.box -->
  43. @else
  44. <p class="alert alert-warning">No brand created yet. <a href="{{ route('admin.brands.create') }}">Create one!</a></p>
  45. @endif
  46. </section>
  47. <!-- /.content -->
  48. @endsection