Initial commit
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
ssww23
2026-03-10 00:55:37 +03:00
parent fc0f28d830
commit 93a655235a
155 changed files with 24768 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
@extends('layouts.shop')
@section('content')
@include('partials.breadcrumbs', [
'items' => [
['label' => 'Админка', 'url' => route('admin.dashboard')],
['label' => 'Товары', 'url' => null],
],
])
<section class="pc-section">
<div class="pc-category-toolbar">
<div class="pc-section-title">
<h2>Товары</h2>
</div>
<div class="pc-product-actions">
<a class="pc-btn primary" href="{{ route('admin.products.create') }}">Добавить товар</a>
<a class="pc-btn ghost" href="{{ route('admin.products.export') }}">Экспорт CSV</a>
</div>
</div>
<div class="pc-card">
<h3>Импорт из CSV</h3>
<p class="pc-muted">Загрузите CSV файл (UTF-8). Поддерживаются колонки category_slug/category_name, name, price, stock и дополнительные характеристики.</p>
<form class="pc-product-actions" method="post" action="{{ route('admin.products.import') }}" enctype="multipart/form-data">
@csrf
<input class="pc-file-input" type="file" name="csv_file" accept=".csv,text/csv" required>
<button class="pc-btn ghost" type="submit">Импорт CSV</button>
</form>
</div>
<div class="pc-card">
@if ($products->isEmpty())
<p>Товары пока не созданы.</p>
@else
<div class="pc-account-orders">
@foreach ($products as $product)
<div class="pc-account-order">
<span>{{ $product->name }} ({{ $product->category?->name ?? 'Без категории' }})</span>
<div class="pc-product-actions">
<a class="pc-btn ghost" href="{{ route('admin.products.edit', $product) }}">Редактировать</a>
<form method="post" action="{{ route('admin.products.destroy', $product) }}">
@csrf
@method('delete')
<button class="pc-btn ghost" type="submit">Удалить</button>
</form>
</div>
</div>
@endforeach
</div>
@endif
</div>
<div class="pc-pagination">
{{ $products->links() }}
</div>
</section>
@endsection