index.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. @extends('projects.layout')
  2. @section('content')
  3. <div class="container">
  4. <h2 class="text-center mt-5 mb-3">Проекты</h2>
  5. <div class="card">
  6. <div class="card-header">
  7. <a class="btn btn-outline-primary" href="{{ route('projects.create') }}">
  8. Создать новый проект
  9. </a>
  10. </div>
  11. <div class="card-body">
  12. @if ($message = Session::get('success'))
  13. <div class="alert alert-success">
  14. <b>{{ $message }}</b>
  15. </div>
  16. @endif
  17. <table class="table table-bordered">
  18. <tr>
  19. <th>Название</th>
  20. <th>Описание</th>
  21. <th width="240px">Действие</th>
  22. </tr>
  23. @foreach ($projects as $project)
  24. <tr>
  25. <td>{{ $project->name }}</td>
  26. <td>{{ $project->description }}</td>
  27. <td>
  28. <form action="{{ route('projects.destroy',$project->id) }}" method="POST">
  29. <a
  30. class="btn btn-outline-info"
  31. href="{{ route('projects.show',$project->id) }}">
  32. Посмотреть
  33. </a>
  34. <a
  35. class="btn btn-outline-success"
  36. href="{{ route('projects.edit',$project->id) }}">
  37. Редактировать
  38. </a>
  39. @csrf
  40. @method('DELETE')
  41. <button type="submit" class="btn btn-outline-danger">Удалить</button>
  42. </form>
  43. </td>
  44. </tr>
  45. @endforeach
  46. </table>
  47. </div>
  48. </div>
  49. </div>
  50. @endsection