diff --git a/app/Enums/CategoryType.php b/app/Enums/CategoryType.php
new file mode 100644
index 0000000..5c22adb
--- /dev/null
+++ b/app/Enums/CategoryType.php
@@ -0,0 +1,30 @@
+ 'Parfum',
+ self::ARTICLE => 'Artikel',
+ };
+ }
+
+ public function color(): string
+ {
+ return match ($this) {
+ self::PERFUME => 'emerald',
+ self::ARTICLE => 'blue',
+ };
+ }
+}
diff --git a/app/Exports/CategoryExport.php b/app/Exports/CategoryExport.php
deleted file mode 100644
index dc67714..0000000
--- a/app/Exports/CategoryExport.php
+++ /dev/null
@@ -1,135 +0,0 @@
-name,
- strip_tags($category->description) ?: '-',
- formatDateLocalized($category->created_at, 'd/m/Y H:i'),
- formatDateLocalized($category->updated_at, 'd/m/Y H:i'),
- ];
- }
-
- public function columnWidths(): array
- {
- return [
- 'A' => 20, // Category Name
- 'B' => 30, // Description
- 'C' => 18, // Created Date
- 'D' => 18, // Updated Date
- ];
- }
-
- /**
- * @return array
- */
- public function styles(Worksheet $sheet)
- {
- $lastRow = $sheet->getHighestRow();
- $lastColumn = $sheet->getHighestColumn();
-
- // Header style
- $headerStyle = [
- 'font' => [
- 'bold' => true,
- 'size' => 12,
- 'color' => ['rgb' => 'FFFFFF'],
- ],
- 'fill' => [
- 'fillType' => Fill::FILL_SOLID,
- 'startColor' => ['rgb' => '78716C'], // Stone - elegant
- ],
- 'alignment' => [
- 'horizontal' => Alignment::HORIZONTAL_CENTER,
- 'vertical' => Alignment::VERTICAL_CENTER,
- ],
- 'borders' => [
- 'allBorders' => [
- 'borderStyle' => Border::BORDER_THIN,
- 'color' => ['rgb' => '000000'],
- ],
- ],
- ];
-
- // Data rows style
- $dataStyle = [
- 'borders' => [
- 'allBorders' => [
- 'borderStyle' => Border::BORDER_THIN,
- 'color' => ['rgb' => '000000'],
- ],
- ],
- 'alignment' => [
- 'vertical' => Alignment::VERTICAL_TOP,
- ],
- ];
-
- return [
- // Header styling
- 1 => $headerStyle,
-
- // Data rows styling
- 'A2:'.$lastColumn.$lastRow => $dataStyle,
- ];
- }
-
- public function registerEvents(): array
- {
- return [
- AfterSheet::class => function (AfterSheet $event) {
- // Auto-size columns with max width
- foreach (range('A', 'D') as $column) {
- $event->sheet->getColumnDimension($column)->setAutoSize(true);
- }
-
- // Set row height for header
- $event->sheet->getRowDimension(1)->setRowHeight(25);
- },
- ];
- }
-}
diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php
index fc788fb..b005074 100644
--- a/app/Http/Controllers/ExportController.php
+++ b/app/Http/Controllers/ExportController.php
@@ -3,7 +3,6 @@
namespace App\Http\Controllers;
use App\Exports\BrandExport;
-use App\Exports\CategoryExport;
use App\Exports\FormulaExport;
use App\Exports\PerfumeExport;
use App\Exports\ProductExport;
@@ -45,17 +44,6 @@ public function formulas(): BinaryFileResponse
);
}
- /**
- * Export categories to Excel
- */
- public function categories(): BinaryFileResponse
- {
- return Excel::download(
- new CategoryExport,
- 'data_kategori_'.now()->format('Y-m-d_H-i-s').'.xlsx'
- );
- }
-
/**
* Export brands to Excel
*/
diff --git a/app/Livewire/Datatable/Manage/ArticlesTable.php b/app/Livewire/Datatable/Manage/ArticlesTable.php
index accaba7..7b9684c 100644
--- a/app/Livewire/Datatable/Manage/ArticlesTable.php
+++ b/app/Livewire/Datatable/Manage/ArticlesTable.php
@@ -11,6 +11,7 @@
use Illuminate\Support\Facades\Blade;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
+use Rappasoft\LaravelLivewireTables\Views\Columns\ArrayColumn;
class ArticlesTable extends DataTableComponent
{
@@ -25,6 +26,11 @@ public function columns(): array
Column::make('Judul', 'title')->searchable(),
+ ArrayColumn::make('Kategori')
+ ->data(fn ($value, $row) => $row->categories->pluck('name')->toArray())
+ ->outputFormat(fn ($index, $value) => Blade::render(''.$value.''))
+ ->flexRow(['class' => 'gap-2 flex-wrap']),
+
Column::make('Status', 'status')
->format(
fn ($value) => Blade::render(''.$value->label().'')
@@ -66,6 +72,6 @@ public function columns(): array
public function builder(): Builder
{
- return Article::select('articles.id', 'author_id', 'title', 'articles.status', 'published_at', 'views')->with(['author', 'author.employee']);
+ return Article::select('articles.id', 'author_id', 'title', 'articles.status', 'published_at', 'views')->with(['author', 'author.employee', 'categories']);
}
}
diff --git a/app/Livewire/Datatable/Catalog/CategoriesTable.php b/app/Livewire/Datatable/Master/CategoriesTable.php
similarity index 91%
rename from app/Livewire/Datatable/Catalog/CategoriesTable.php
rename to app/Livewire/Datatable/Master/CategoriesTable.php
index 12e9d2f..114f34a 100644
--- a/app/Livewire/Datatable/Catalog/CategoriesTable.php
+++ b/app/Livewire/Datatable/Master/CategoriesTable.php
@@ -1,12 +1,13 @@
searchable(),
+ Column::make('Jenis', 'type')
+ ->label(fn ($row, $column) => Blade::render(''.$row->type->label().''))
+ ->html(),
+
ImageColumn::make('Gambar')
->location(fn ($row) => optional($row->getMedia('image')->first())->getUrl() ?? asset('assets/images/logo.png'))
->attributes(fn ($row) => [
@@ -99,6 +104,6 @@ public function columns(): array
public function builder(): Builder
{
- return Category::select('id', 'name', 'sort_order')->orderBy('sort_order');
+ return Category::select('id', 'name', 'type', 'sort_order')->orderBy('sort_order');
}
}
diff --git a/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php b/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php
index a3ff9b4..889d09f 100644
--- a/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php
+++ b/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php
@@ -76,7 +76,10 @@ public function rules(): array
'quota' => ['nullable', new UnsignedInteger],
'limit_per_user' => ['nullable', new UnsignedInteger],
'summary' => ['required', 'string', 'max:200'],
- 'start_date' => ['required', 'date', 'after:yesterday'],
+ 'start_date' => ['required', 'date', Rule::when(
+ $this->start_date !== $this->voucher->start_date,
+ 'after_or_equal:today'
+ )],
'end_date' => ['nullable', 'date', 'after_or_equal:start_date'],
'tier_ids' => ['required', 'array', 'min:1'],
'tier_ids.*' => Rule::exists('tiers', 'id'),
diff --git a/app/Livewire/Forms/Studio/Manage/ArticleForm.php b/app/Livewire/Forms/Studio/Manage/ArticleForm.php
index 2beb795..4d6681a 100644
--- a/app/Livewire/Forms/Studio/Manage/ArticleForm.php
+++ b/app/Livewire/Forms/Studio/Manage/ArticleForm.php
@@ -23,6 +23,8 @@ class ArticleForm extends Form
public string $status = '1';
+ public array $category_ids = [];
+
public array $thumbnail = [];
public function rules(): array
@@ -32,6 +34,8 @@ public function rules(): array
'excerpt' => ['required', 'string'],
'content' => ['required', 'string'],
'status' => ['required', Rule::in(ArticleStatus::cases())],
+ 'category_ids' => ['required', 'array', 'min:1'],
+ 'category_ids.*' => Rule::exists('categories', 'id'),
'thumbnail' => ['required', 'array'],
];
}
@@ -42,6 +46,8 @@ public function validationAttributes(): array
'title' => 'judul',
'excerpt' => 'cuplikan',
'content' => 'konten',
+ 'category_ids' => 'kategori',
+ 'category_ids.*' => 'kategori',
];
}
@@ -53,6 +59,7 @@ public function setArticle(Article $article): void
$this->excerpt = $article->excerpt;
$this->content = $article->content;
$this->status = $article->status->value;
+ $this->category_ids = $article->categories->pluck('id')->toArray();
$this->thumbnail = $this->mapMediaCollection($article->getMedia('thumbnail'));
}
@@ -70,6 +77,8 @@ public function store(): string
'published_at' => $this->status == ArticleStatus::PUBLISHED->value ? now() : null,
]);
+ $article->categories()->sync($this->category_ids);
+
$this->uploadMedia($this->thumbnail, $article, 'thumbnail');
});
@@ -93,6 +102,8 @@ public function update(): void
: []
));
+ $this->article->categories()->sync($this->category_ids);
+
$this->syncMedia($this->thumbnail, $this->article, 'thumbnail');
$this->uploadMedia($this->thumbnail, $this->article, 'thumbnail');
});
diff --git a/app/Livewire/Forms/Studio/Catalog/CategoryForm.php b/app/Livewire/Forms/Studio/Master/CategoryForm.php
similarity index 62%
rename from app/Livewire/Forms/Studio/Catalog/CategoryForm.php
rename to app/Livewire/Forms/Studio/Master/CategoryForm.php
index f5a4cb8..89ba3ca 100644
--- a/app/Livewire/Forms/Studio/Catalog/CategoryForm.php
+++ b/app/Livewire/Forms/Studio/Master/CategoryForm.php
@@ -1,7 +1,8 @@
value;
+
public array $image = [];
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:20', Rule::unique('categories', 'name')->whereNull('deleted_at')->ignore($this->category)],
- 'description' => 'nullable',
- 'image' => 'array',
+ 'description' => $this->type === CategoryType::PERFUME->value ? 'nullable' : 'prohibited',
+ 'type' => ['required', Rule::in(CategoryType::values())],
+ 'image' => $this->type === CategoryType::PERFUME->value ? 'array' : 'prohibited',
];
}
@@ -35,6 +39,7 @@ public function validationAttributes(): array
return [
'name' => 'nama',
'description' => 'deskripsi',
+ 'type' => 'tipe',
'image' => 'gambar',
];
}
@@ -45,6 +50,7 @@ public function setCategory(Category $category): void
$this->name = $category->name;
$this->description = $category->description;
+ $this->type = $category->type->value;
$this->image = $this->mapMediaCollection($category->getMedia('image'));
}
@@ -59,11 +65,14 @@ public function store(): void
$category = Category::create([
'name' => $this->name,
- 'description' => $this->description,
+ 'description' => $this->type === CategoryType::PERFUME->value ? $this->description : null,
+ 'type' => $this->type,
'sort_order' => 1,
]);
- $this->uploadMedia($this->image, $category, 'image');
+ if ($this->type === CategoryType::PERFUME->value) {
+ $this->uploadMedia($this->image, $category, 'image');
+ }
});
}
@@ -74,11 +83,16 @@ public function update(): void
DB::transaction(function () {
$this->category->update([
'name' => $this->name,
- 'description' => $this->description,
+ 'description' => $this->type === CategoryType::PERFUME->value ? $this->description : null,
+ 'type' => $this->type,
]);
- $this->syncMedia($this->image, $this->category, 'image');
- $this->uploadMedia($this->image, $this->category, 'image');
+ if ($this->type === CategoryType::PERFUME->value) {
+ $this->syncMedia($this->image, $this->category, 'image');
+ $this->uploadMedia($this->image, $this->category, 'image');
+ } else {
+ $this->category->clearMediaCollection('image');
+ }
});
}
diff --git a/app/Livewire/Studio/Catalog/Perfume/Create.php b/app/Livewire/Studio/Catalog/Perfume/Create.php
index dba9daf..9dee231 100644
--- a/app/Livewire/Studio/Catalog/Perfume/Create.php
+++ b/app/Livewire/Studio/Catalog/Perfume/Create.php
@@ -36,7 +36,7 @@ public function mount(): void
$this->brands = Brand::pluck('name', 'id')->toArray();
- $this->categories = Category::pluck('name', 'id')->toArray();
+ $this->categories = Category::perfume()->pluck('name', 'id')->toArray();
}
public function save(): void
diff --git a/app/Livewire/Studio/Manage/Article/Create.php b/app/Livewire/Studio/Manage/Article/Create.php
index 2ea26c7..0899bdf 100644
--- a/app/Livewire/Studio/Manage/Article/Create.php
+++ b/app/Livewire/Studio/Manage/Article/Create.php
@@ -2,10 +2,13 @@
namespace App\Livewire\Studio\Manage\Article;
+use App\Enums\CategoryType;
use App\Jobs\StorePushNotification;
use App\Livewire\Forms\Studio\Manage\ArticleForm;
+use App\Models\Category;
use App\Models\PushNotification;
use App\Traits\Authorization\WithAuthorization;
+use App\Traits\Components\WithCategorySelector;
use App\Traits\Components\WithToast;
use App\Traits\Utilities\WithUpdatedData;
use Illuminate\Contracts\View\View;
@@ -16,10 +19,17 @@
#[Title('Tambah Artikel')]
class Create extends Component
{
- use WithAuthorization, WithToast, WithUpdatedData;
+ use WithAuthorization, WithCategorySelector, WithToast, WithUpdatedData;
public ArticleForm $form;
+ public array $categories = [];
+
+ public function mount(): void
+ {
+ $this->categories = Category::article()->pluck('name', 'id')->toArray();
+ }
+
public function save(): void
{
$this->canOrAbort('create article');
@@ -43,6 +53,7 @@ public function render(): View
{
return view('livewire.studio.manage.article.form', [
'pageTitle' => 'Tambah Artikel',
+ 'categories' => Category::query()->where('type', CategoryType::ARTICLE)->orderBy('sort_order')->get(),
]);
}
}
diff --git a/app/Livewire/Studio/Manage/Article/Edit.php b/app/Livewire/Studio/Manage/Article/Edit.php
index c2f373e..d55149e 100644
--- a/app/Livewire/Studio/Manage/Article/Edit.php
+++ b/app/Livewire/Studio/Manage/Article/Edit.php
@@ -2,9 +2,12 @@
namespace App\Livewire\Studio\Manage\Article;
+use App\Enums\CategoryType;
use App\Livewire\Forms\Studio\Manage\ArticleForm;
use App\Models\Article;
+use App\Models\Category;
use App\Traits\Authorization\WithAuthorization;
+use App\Traits\Components\WithCategorySelector;
use App\Traits\Components\WithToast;
use App\Traits\Utilities\WithUpdatedData;
use Illuminate\Contracts\View\View;
@@ -14,13 +17,17 @@
#[Title('Ubah Artikel')]
class Edit extends Component
{
- use WithAuthorization, WithToast, WithUpdatedData;
+ use WithAuthorization, WithCategorySelector, WithToast, WithUpdatedData;
public ArticleForm $form;
+ public array $categories = [];
+
public function mount(Article $article): void
{
$this->form->setArticle($article);
+
+ $this->categories = Category::article()->pluck('name', 'id')->toArray();
}
public function save(): void
@@ -38,6 +45,7 @@ public function render(): View
{
return view('livewire.studio.manage.article.form', [
'pageTitle' => 'Ubah Artikel',
+ 'categories' => Category::query()->where('type', CategoryType::ARTICLE)->orderBy('sort_order')->get(),
]);
}
}
diff --git a/app/Livewire/Studio/Catalog/Category.php b/app/Livewire/Studio/Master/Category.php
similarity index 93%
rename from app/Livewire/Studio/Catalog/Category.php
rename to app/Livewire/Studio/Master/Category.php
index 0c0b5e3..8549c9a 100644
--- a/app/Livewire/Studio/Catalog/Category.php
+++ b/app/Livewire/Studio/Master/Category.php
@@ -1,8 +1,8 @@
'Kategori',
]);
}
diff --git a/app/Models/Article.php b/app/Models/Article.php
index eed2170..be4f5ad 100644
--- a/app/Models/Article.php
+++ b/app/Models/Article.php
@@ -6,6 +6,7 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
@@ -39,4 +40,9 @@ public function author(): BelongsTo
{
return $this->belongsTo(User::class, 'author_id');
}
+
+ public function categories(): BelongsToMany
+ {
+ return $this->belongsToMany(Category::class);
+ }
}
diff --git a/app/Models/ArticleCategory.php b/app/Models/ArticleCategory.php
new file mode 100644
index 0000000..f9c32b8
--- /dev/null
+++ b/app/Models/ArticleCategory.php
@@ -0,0 +1,12 @@
+ 'int',
+ 'type' => CategoryType::class,
];
}
+ #[Scope]
+ protected function perfume(Builder $query): Builder
+ {
+ return $query->where('type', CategoryType::PERFUME);
+ }
+
+ #[Scope]
+ protected function article(Builder $query): Builder
+ {
+ return $query->where('type', CategoryType::ARTICLE);
+ }
+
public function getSlugOptions(): SlugOptions
{
return SlugOptions::create()
@@ -36,4 +52,9 @@ public function perfumes(): BelongsToMany
{
return $this->belongsToMany(Perfume::class);
}
+
+ public function articles(): BelongsToMany
+ {
+ return $this->belongsToMany(Article::class);
+ }
}
diff --git a/app/Providers/ViewServiceProvider.php b/app/Providers/ViewServiceProvider.php
index 8da9bf7..f3a7162 100644
--- a/app/Providers/ViewServiceProvider.php
+++ b/app/Providers/ViewServiceProvider.php
@@ -71,6 +71,13 @@ public function boot(): void
'match' => 'studio.master.formula.*',
'can' => 'view formula',
],
+ [
+ 'label' => 'Kategori',
+ 'icon' => 'list-bullet',
+ 'route' => 'studio.master.category.index',
+ 'match' => 'studio.master.category.*',
+ 'can' => 'view category',
+ ],
],
],
[
@@ -116,13 +123,6 @@ public function boot(): void
[
'heading' => 'Katalog',
'items' => [
- [
- 'label' => 'Kategori',
- 'icon' => 'list-bullet',
- 'route' => 'studio.catalog.category.index',
- 'match' => 'studio.catalog.category.*',
- 'can' => 'view category',
- ],
[
'label' => 'Merek',
'icon' => 'tag',
diff --git a/database/migrations/2025_09_29_062630_create_categories_table.php b/database/migrations/2025_09_29_062630_create_categories_table.php
index 84dce9e..69c2112 100644
--- a/database/migrations/2025_09_29_062630_create_categories_table.php
+++ b/database/migrations/2025_09_29_062630_create_categories_table.php
@@ -1,5 +1,6 @@
string('name', 20);
$table->string('slug', 30);
$table->text('description')->nullable();
+ $table->integer('type')->default(CategoryType::PERFUME->value)->comment(CategoryType::comment());
$table->unsignedInteger('sort_order');
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
diff --git a/database/migrations/2025_12_21_005018_create_article_category_table.php b/database/migrations/2025_12_21_005018_create_article_category_table.php
new file mode 100644
index 0000000..c53881b
--- /dev/null
+++ b/database/migrations/2025_12_21_005018_create_article_category_table.php
@@ -0,0 +1,30 @@
+id();
+ $table->foreignId('article_id')->constrained()->cascadeOnDelete();
+ $table->foreignId('category_id')->constrained()->cascadeOnDelete();
+ $table->timestamp('created_at')->useCurrent();
+ $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('article_category');
+ }
+};
diff --git a/resources/views/livewire/studio/catalog/perfume/index.blade.php b/resources/views/livewire/studio/catalog/perfume/index.blade.php
index 85acea9..0823684 100644
--- a/resources/views/livewire/studio/catalog/perfume/index.blade.php
+++ b/resources/views/livewire/studio/catalog/perfume/index.blade.php
@@ -5,7 +5,7 @@
@can('view product')
-
+
Ekspor Ecxel
diff --git a/resources/views/livewire/studio/manage/article/form.blade.php b/resources/views/livewire/studio/manage/article/form.blade.php
index 5493603..1d5d19e 100644
--- a/resources/views/livewire/studio/manage/article/form.blade.php
+++ b/resources/views/livewire/studio/manage/article/form.blade.php
@@ -53,6 +53,24 @@
+
+
+ Kategori *
+
+ Pilih Semua
+
+ Hapus Semua
+
+ @foreach ($categories as $key => $value)
+ {{ $value }}
+
+ @endforeach
+
+
+
+
+
Thumbnail *
diff --git a/resources/views/livewire/studio/catalog/categories.blade.php b/resources/views/livewire/studio/master/categories.blade.php
similarity index 84%
rename from resources/views/livewire/studio/catalog/categories.blade.php
rename to resources/views/livewire/studio/master/categories.blade.php
index 1331054..e161efe 100644
--- a/resources/views/livewire/studio/catalog/categories.blade.php
+++ b/resources/views/livewire/studio/master/categories.blade.php
@@ -4,13 +4,6 @@
{{ $pageTitle }}
- @can('view category')
-
-
- Ekspor Ecxel
-
-
- @endcan
@can('create category')
-
+
@include('components.modals.confirmation', [
@@ -47,6 +40,18 @@
placeholder="Aromaterapi merupakan wewangian yang dapat membantu meredakan stress dan meredakan perasaan sakit kepala."
auotocomplete="off" class="**:data-[slot=content]:min-h-[100px]!" />
+
+ Jenis *
+
+ @foreach (\App\Enums\CategoryType::cases() as $item)
+
+ {{ $item->label() }}
+
+ @endforeach
+
+
+
+
Gambar
diff --git a/resources/views/livewire/studio/master/formulas.blade.php b/resources/views/livewire/studio/master/formulas.blade.php
index 4c29589..b85696b 100644
--- a/resources/views/livewire/studio/master/formulas.blade.php
+++ b/resources/views/livewire/studio/master/formulas.blade.php
@@ -5,7 +5,7 @@
@can('view formula')
-
+
Ekspor Ecxel
diff --git a/routes/pages/studio.php b/routes/pages/studio.php
index 3d8d503..b5e5c88 100644
--- a/routes/pages/studio.php
+++ b/routes/pages/studio.php
@@ -6,7 +6,6 @@
use App\Livewire\Studio\Catalog\Bottle\Edit as BottleEdit;
use App\Livewire\Studio\Catalog\Bottle\Index as BottleIndex;
use App\Livewire\Studio\Catalog\Brand as BrandComponent;
-use App\Livewire\Studio\Catalog\Category as CategoryComponent;
use App\Livewire\Studio\Catalog\Perfume\Audit as PerfumeAudit;
use App\Livewire\Studio\Catalog\Perfume\Create as PerfumeCreate;
use App\Livewire\Studio\Catalog\Perfume\Edit as PerfumeEdit;
@@ -43,6 +42,7 @@
use App\Livewire\Studio\Manage\StockOpname\Index as StockOpnameIndex;
use App\Livewire\Studio\Manage\StockOpname\Manage as StockOpnameManage;
use App\Livewire\Studio\Manage\StockOpname\Show as StockOpnameShow;
+use App\Livewire\Studio\Master\Category as CategoryComponent;
use App\Livewire\Studio\Master\Formula as FormulaComponent;
use App\Livewire\Studio\Master\Outlet\Create as OutletCreate;
use App\Livewire\Studio\Master\Outlet\Edit as OutletEdit;
@@ -81,6 +81,10 @@
Route::prefix('formulas')->name('formula.')->group(function () {
Route::get('/', FormulaComponent::class)->name('index')->middleware('can:view formula');
});
+
+ Route::prefix('categories')->name('category.')->group(function () {
+ Route::get('/', CategoryComponent::class)->name('index')->middleware('can:view category');
+ });
});
Route::prefix('loyalty')->name('studio.loyalty.')->group(function () {
@@ -106,10 +110,6 @@
});
Route::prefix('catalog')->name('studio.catalog.')->group(function () {
- Route::prefix('categories')->name('category.')->group(function () {
- Route::get('/', CategoryComponent::class)->name('index')->middleware('can:view category');
- });
-
Route::prefix('brands')->name('brand.')->group(function () {
Route::get('/', BrandComponent::class)->name('index')->middleware('can:view brand');
});
@@ -203,10 +203,9 @@
// Export Routes
Route::prefix('export')->name('studio.export.')->group(function () {
- Route::get('/perfumes', [ExportController::class, 'perfumes'])->name('perfumes')->middleware('can:view perfume');
- Route::get('/products', [ExportController::class, 'products'])->name('products')->middleware('can:view product');
- Route::get('/formulas', [ExportController::class, 'formulas'])->name('formulas')->middleware('can:view formula');
- Route::get('/categories', [ExportController::class, 'categories'])->name('categories')->middleware('can:view category');
- Route::get('/brands', [ExportController::class, 'brands'])->name('brands')->middleware('can:view brand');
+ Route::get('/perfumes', [ExportController::class, 'perfumes'])->name('perfume')->middleware('can:view perfume');
+ Route::get('/products', [ExportController::class, 'products'])->name('product')->middleware('can:view product');
+ Route::get('/formulas', [ExportController::class, 'formulas'])->name('formula')->middleware('can:view formula');
+ Route::get('/brands', [ExportController::class, 'brands'])->name('brand')->middleware('can:view brand');
});
});