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,21 @@
<label>
Название
<input type="text" name="name" value="{{ old('name', $category->name ?? '') }}" required>
</label>
<label>
Slug
<input type="text" name="slug" value="{{ old('slug', $category->slug ?? '') }}" placeholder="Можно оставить пустым">
</label>
<label>
Описание
<textarea name="description">{{ old('description', $category->description ?? '') }}</textarea>
</label>
<label class="pc-checkbox">
<input type="checkbox" name="is_active" value="1" @checked(old('is_active', $category->is_active ?? true))>
<span>Категория активна</span>
</label>
<button class="pc-btn primary" type="submit">{{ $submitLabel ?? 'Сохранить' }}</button>

View File

@@ -0,0 +1,22 @@
@extends('layouts.shop')
@section('content')
@include('partials.breadcrumbs', [
'items' => [
['label' => 'Админка', 'url' => route('admin.dashboard')],
['label' => 'Категории', 'url' => route('admin.categories.index')],
['label' => 'Новая категория', 'url' => null],
],
])
<section class="pc-section">
<div class="pc-section-title">
<h2>Новая категория</h2>
</div>
<form class="pc-card pc-form" method="post" action="{{ route('admin.categories.store') }}">
@csrf
@include('admin.categories._form', ['submitLabel' => 'Создать'])
</form>
</section>
@endsection

View File

@@ -0,0 +1,23 @@
@extends('layouts.shop')
@section('content')
@include('partials.breadcrumbs', [
'items' => [
['label' => 'Админка', 'url' => route('admin.dashboard')],
['label' => 'Категории', 'url' => route('admin.categories.index')],
['label' => 'Редактирование', 'url' => null],
],
])
<section class="pc-section">
<div class="pc-section-title">
<h2>Редактирование категории</h2>
</div>
<form class="pc-card pc-form" method="post" action="{{ route('admin.categories.update', $category) }}">
@csrf
@method('put')
@include('admin.categories._form', ['category' => $category, 'submitLabel' => 'Сохранить'])
</form>
</section>
@endsection

View File

@@ -0,0 +1,45 @@
@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>
<a class="pc-btn primary" href="{{ route('admin.categories.create') }}">Добавить категорию</a>
</div>
<div class="pc-card">
@if ($categories->isEmpty())
<p>Категории пока не созданы.</p>
@else
<div class="pc-account-orders">
@foreach ($categories as $category)
<div class="pc-account-order">
<span>{{ $category->name }} ({{ $category->slug }})</span>
<div class="pc-product-actions">
<a class="pc-btn ghost" href="{{ route('admin.categories.edit', $category) }}">Редактировать</a>
<form method="post" action="{{ route('admin.categories.destroy', $category) }}">
@csrf
@method('delete')
<button class="pc-btn ghost" type="submit">Удалить</button>
</form>
</div>
</div>
@endforeach
</div>
@endif
</div>
<div class="pc-pagination">
{{ $categories->links() }}
</div>
</section>
@endsection