diff --git a/app/Livewire/Datatable/Feature/ChooseUsTable.php b/app/Livewire/Datatable/Feature/ChooseUsTable.php index 48b3f6e..1d615ff 100644 --- a/app/Livewire/Datatable/Feature/ChooseUsTable.php +++ b/app/Livewire/Datatable/Feature/ChooseUsTable.php @@ -6,6 +6,7 @@ use App\Traits\Datatable\WithConfiguration; use App\Traits\Datatable\WithPrependColumn; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Facades\Blade; use Rappasoft\LaravelLivewireTables\DataTableComponent; use Rappasoft\LaravelLivewireTables\Views\Column; @@ -22,6 +23,14 @@ public function columns(): array Column::make('Keterangan', 'description')->searchable()->sortable(), + Column::make('Icon', 'icon') + ->format(function ($value) { + return Blade::render(''); + }) + ->html() + ->searchable() + ->sortable(), + Column::make('Aksi') ->label(function ($row) { $actions = ''; diff --git a/app/Livewire/Forms/Studio/Feature/ChooseUsForm.php b/app/Livewire/Forms/Studio/Feature/ChooseUsForm.php index f3549c9..510aa37 100644 --- a/app/Livewire/Forms/Studio/Feature/ChooseUsForm.php +++ b/app/Livewire/Forms/Studio/Feature/ChooseUsForm.php @@ -17,11 +17,14 @@ class ChooseUsForm extends Form public string $description = ''; + public string $icon = ''; + public function rules(): array { return [ 'name' => ['required', 'string', 'max:50'], 'description' => ['required', 'string'], + 'icon' => ['required', 'string', 'max:30'], ]; } @@ -30,6 +33,7 @@ public function validationAttributes(): array return [ 'name' => 'nama', 'description' => 'keterangan', + 'icon' => 'ikon', ]; } @@ -39,6 +43,7 @@ public function setChooseUs(ChooseUs $chooseUs): void $this->name = $chooseUs->name; $this->description = $chooseUs->description; + $this->icon = $chooseUs->icon; } public function store(): void @@ -52,6 +57,7 @@ public function store(): void ChooseUs::create([ 'name' => $this->name, 'description' => $this->description, + 'icon' => $this->icon, 'sort_order' => 1, ]); }); @@ -64,6 +70,7 @@ public function update(): void $this->chooseUs->update([ 'name' => $this->name, 'description' => $this->description, + 'icon' => $this->icon, ]); } diff --git a/app/Livewire/Home/Index.php b/app/Livewire/Home/Index.php index b08664a..8e5a5cf 100644 --- a/app/Livewire/Home/Index.php +++ b/app/Livewire/Home/Index.php @@ -63,13 +63,7 @@ public function mount(): void }) ->toArray(); - $this->whyChooseUs = ChooseUs::orderBy('sort_order') - ->get() - ->map(fn (ChooseUs $chooseUs) => [ - 'name' => $chooseUs->name, - 'description' => $chooseUs->description, - ]) - ->toArray(); + $this->whyChooseUs = ChooseUs::orderBy('sort_order')->get()->toArray(); $this->perfumeFeatures = PerfumeFeature::orderBy('sort_order') ->get() diff --git a/database/migrations/2025_11_06_100555_create_choose_us_table.php b/database/migrations/2025_11_06_100555_create_choose_us_table.php index 2f4bab7..519fbae 100644 --- a/database/migrations/2025_11_06_100555_create_choose_us_table.php +++ b/database/migrations/2025_11_06_100555_create_choose_us_table.php @@ -14,6 +14,7 @@ public function up(): void Schema::create('choose_us', function (Blueprint $table) { $table->id(); $table->string('name', 50); + $table->string('icon', 30); $table->text('description'); $table->unsignedInteger('sort_order'); $table->timestamp('created_at')->useCurrent(); diff --git a/database/seeders/ChooseUsSeeder.php b/database/seeders/ChooseUsSeeder.php index b0ee7e7..abde799 100644 --- a/database/seeders/ChooseUsSeeder.php +++ b/database/seeders/ChooseUsSeeder.php @@ -14,41 +14,25 @@ public function run(): void 'name' => 'Produk 100% Original', 'description' => 'Kami hanya menjual parfum original dari brand resmi, tanpa campuran atau versi KW.', 'sort_order' => 1, + 'icon' => 'shield-check', ], [ 'name' => 'Harga Terbaik', 'description' => 'Dapatkan harga kompetitif dan promo menarik setiap minggu untuk semua produk.', 'sort_order' => 2, - ], - [ - 'name' => 'Pengiriman Cepat', - 'description' => 'Pesananmu akan dikirim maksimal 24 jam setelah pembayaran dikonfirmasi.', - 'sort_order' => 3, - ], - [ - 'name' => 'Garansi Produk', - 'description' => 'Jika parfum rusak atau salah kirim, kami siap menggantinya tanpa ribet.', - 'sort_order' => 4, + 'icon' => 'tag', ], [ 'name' => 'Layanan Pelanggan Ramah', 'description' => 'Tim kami siap membantu kamu setiap hari melalui chat, email, dan media sosial.', 'sort_order' => 5, - ], - [ - 'name' => 'Program Member Eksklusif', - 'description' => 'Dapatkan poin reward, diskon spesial, dan akses promo terbatas sebagai member.', - 'sort_order' => 6, + 'icon' => 'chat-bubble-left-right', ], [ 'name' => 'Koleksi Parfum Lengkap', 'description' => 'Tersedia berbagai merek parfum internasional dan lokal dengan varian aroma terbaik.', 'sort_order' => 7, - ], - [ - 'name' => 'Belanja Aman dan Nyaman', - 'description' => 'Sistem pembayaran terenkripsi dan kebijakan privasi menjaga data pelanggan tetap aman.', - 'sort_order' => 8, + 'icon' => 'cube', ], ]); } diff --git a/resources/views/livewire/home/partials/why.blade.php b/resources/views/livewire/home/partials/why.blade.php index 8853b21..e9aabc2 100644 --- a/resources/views/livewire/home/partials/why.blade.php +++ b/resources/views/livewire/home/partials/why.blade.php @@ -32,72 +32,20 @@ class="rounded-2xl w-full h-[400px] lg:h-[500px] object-cover shadow-xl">
-
-
- - - -
-

Keaslian 100%

-

- Setiap botol dijamin original dari distributor resmi untuk kualitas dan aroma yang murni. -

-
- -
-
- - - -
-

Pengiriman Cepat

-

- Pesananmu diproses dan dikirim di hari yang sama untuk sampai lebih cepat dan aman. -

-
- -
-
- - - -
-

Harga Bersahabat

-

- Nikmati parfum favorit dengan harga kompetitif tanpa mengurangi kualitas premium. -

-
- -
-
- - - -
-

Layanan Terbaik

-

- Tim customer service kami siap membantu 24/7 untuk pengalaman belanja yang sempurna. -

-
+ @foreach ($whyChooseUs as $whyChoose) +
+
+ +
+

{{ $whyChoose['name'] }}

+

+ {{ $whyChoose['description'] }} +

+
+ @endforeach
diff --git a/resources/views/livewire/studio/feature/choose-us.blade.php b/resources/views/livewire/studio/feature/choose-us.blade.php index 7c7f9bd..cacbc6e 100644 --- a/resources/views/livewire/studio/feature/choose-us.blade.php +++ b/resources/views/livewire/studio/feature/choose-us.blade.php @@ -34,8 +34,7 @@ Nama * - + @@ -45,6 +44,14 @@ auotocomplete="off" /> + + Icon * + Lihat dan copy icon nya di Heroicons + + + +