edit.blade.php 1.75 KB
@extends('layout.admin', ['title' => 'Редактирование товара'])

@section('content')
    <div class="profile-block-wrapper">
        <div class="profile-block">
            <h2 class="modal-auth__title">
                Редактирование товара
            </h2>
            <form method="post" enctype="multipart/form-data" class="modal-auth-form" action="{{ route('admin.goods.update', ['good' => $good->id]) }}">
                @include('admin.goods.form')
            </form>

            <h3>Дополнительные картинки</h3>
            <a style="color:green" href="{{ route ('admin.img.good', ['good' => $good->id]) }}">Добавить картинку в галерею</a>
            <table class="table" style="width: 100%">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>Фото</th>
                    <th>Действия</th>
                </tr>
                </thead>
                <tbody>
                @if ($good->images->count())
                    @foreach($good->images as $img)
                        <tr>
                            <td><?=$img->id?></td>
                            <td><img src="<?=asset(Storage::url($img->image))?>" width="100px"/></td>
                            <td><a href="{{ route('admin.img.del.good', ['id'=> $img->id, 'good' => $good->id]) }}">Удалить</a></td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td>-</td>
                        <td>-</td>
                        <td>-</td>
                    </tr>
                @endif
                </tbody>
            </table>
        </div>
    </div>
@endsection