feat: implement interactive product storefront with cart, filtering, and dark mode support
This commit is contained in:
parent
8609c68a6d
commit
544afe7334
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Services\Master;
|
namespace App\Services\Master;
|
||||||
|
|
||||||
use App\Jobs\SendPushNotificationJob;
|
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
@ -34,12 +33,7 @@ public function paginateForIndex(array $tableQuery): LengthAwarePaginator
|
|||||||
*/
|
*/
|
||||||
public function create(array $validated): void
|
public function create(array $validated): void
|
||||||
{
|
{
|
||||||
$category = Category::create($validated);
|
Category::create($validated);
|
||||||
|
|
||||||
SendPushNotificationJob::dispatch(
|
|
||||||
'📦 Kategori Baru',
|
|
||||||
"Kategori '{$category->name}' telah ditambahkan.",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,22 +42,11 @@ public function create(array $validated): void
|
|||||||
public function update(Category $category, array $validated): void
|
public function update(Category $category, array $validated): void
|
||||||
{
|
{
|
||||||
$category->fill($validated)->save();
|
$category->fill($validated)->save();
|
||||||
|
|
||||||
SendPushNotificationJob::dispatch(
|
|
||||||
'✏️ Kategori Diperbarui',
|
|
||||||
"Kategori '{$category->name}' telah diperbarui.",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(Category $category): void
|
public function delete(Category $category): void
|
||||||
{
|
{
|
||||||
$name = $category->name;
|
|
||||||
$category->delete();
|
$category->delete();
|
||||||
|
|
||||||
SendPushNotificationJob::dispatch(
|
|
||||||
'🗑️ Kategori Dihapus',
|
|
||||||
"Kategori '{$name}' telah dihapus.",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function applySorting(Builder $query, string $sort, string $direction): void
|
private function applySorting(Builder $query, string $sort, string $direction): void
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user