Blame view

resources/views/admin/banners/index.blade.php 2.5 KB
c5118e5f3   Андрей Ларионов   Админка сайта - в...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  @extends('layout.admin', ['title' => 'Профиль пользователя'])
  
  @section('content')
      <!-- главный экран -->
      <div class="profile-block-wrapper">
          <div class="profile-block">
              <a href="{{ route('admin.banner.create') }}" class="btn banner-container__button" style="margin: 0px;">
                  Создать баннер
              </a><br><br>
  
              <table class="table" style="width: 100%">
                  <thead>
                  <tr>
                      <th>ID</th>
                      <th>Фото</th>
                      <th>Заголовок</th>
                      <th>Дата создания</th>
                      <th>Действия</th>
                  </tr>
                  </thead>
                  <tbody>
                  @if ($banners->count())
                      @foreach($banners as $banner)
                          <tr>
                              <td>{{ $banner->id }}</td>
                              <td><? if (empty($banner->image)) {?>Нет фото<?} else {?>
                                  <!--<img src="/storage/app/public/<?//=$area->foto_main; //=asset(Storage::url($area->foto_main))?>" width="100px"/>-->
                                  <img src="<?=asset(Storage::url($banner->image))?>" width="100px"/>
                                  <?}?></td>
  
                              <td>{{ $banner->title }}</td>
                              <td>{{ $banner->created_at }}</td>
                              <td> <form action="{{ route('admin.banner.destroy', $banner) }}" method="POST">
                                      <a  href="{{ route('admin.banner.edit', ['banner' => $banner->id]) }}">
                                          Редактировать
                                      </a> |
                                      @csrf
                                      @method('DELETE')
                                      <input class=" btn-danger" type="submit" value="Удалить">
                                  </form>
                              </td>
                          </tr>
                      @endforeach
                  @else
                      <tr>
                          <td>-</td>
                          <td>-</td>
                          <td>-</td>
                          <td>-</td>
                          <td>-</td>
                      </tr>
                  @endif
  
                  </tbody>
              </table>
  
              {{ $banners->onEachSide(1)->links('catalogs.paginate') }}
  
          </div>
      </div>
  @endsection