diff --git a/app/Livewire/Datatable/Studio/Catalog/BottlesTable.php b/app/Livewire/Datatable/Studio/Catalog/BottlesTable.php index 41a0b7d..80884ff 100644 --- a/app/Livewire/Datatable/Studio/Catalog/BottlesTable.php +++ b/app/Livewire/Datatable/Studio/Catalog/BottlesTable.php @@ -69,22 +69,22 @@ public function columns(): array ->hideIf(! auth()->user()->hasRole(['Developer', 'Owner'])), Column::make('Harga Jual', 'sale_price') - ->label(fn($row, $column) => currency($row->sale_price, 'Rp')) + ->label(fn ($row, $column) => currency($row->sale_price, 'Rp')) ->searchable() ->sortable(), ImageColumn::make('Gambar') - ->location(fn($row) => optional($row->getMedia('image')->first())->getUrl() ?? asset('assets/images/logo.png')) - ->attributes(fn($row) => [ + ->location(fn ($row) => optional($row->getMedia('image')->first())->getUrl() ?? asset('assets/images/logo.png')) + ->attributes(fn ($row) => [ 'style' => 'width: 50px; height: 50px;', 'alt' => $row->name, ]), ArrayColumn::make('Outlet') ->data( - fn($value, $row) => $row->outlets - ->filter(fn($outlet) => auth()->user()->outlets->pluck('id')->contains($outlet->id)) - ->map(fn($outlet) => [ + fn ($value, $row) => $row->outlets + ->filter(fn ($outlet) => auth()->user()->outlets->pluck('id')->contains($outlet->id)) + ->map(fn ($outlet) => [ 'id' => $outlet->hash, 'bottle_id' => $row->hash, 'name' => $outlet->name, @@ -96,7 +96,7 @@ public function columns(): array $canAudit = auth()->user()->can('audit bottle'); $tag = $canAudit ? 'div' : 'a'; - $attrs = $canAudit ? '' : 'href="' . $route . '" wire:navigate'; + $attrs = $canAudit ? '' : 'href="'.$route.'" wire:navigate'; return Blade::render(" <{$tag} {$attrs} @@ -142,7 +142,7 @@ public function builder(): Builder ->with('outlets') ->whereHas( 'outlets', - fn($q) => $q->whereIn('outlets.id', auth()->user()->outlets()->pluck('outlets.id')) + fn ($q) => $q->whereIn('outlets.id', auth()->user()->outlets()->pluck('outlets.id')) ); } } diff --git a/app/Livewire/Datatable/Studio/Catalog/PerfumesTable.php b/app/Livewire/Datatable/Studio/Catalog/PerfumesTable.php index 57b8f64..56a3301 100644 --- a/app/Livewire/Datatable/Studio/Catalog/PerfumesTable.php +++ b/app/Livewire/Datatable/Studio/Catalog/PerfumesTable.php @@ -47,14 +47,14 @@ public function columns(): array ->html(), ArrayColumn::make('Kategori') - ->data(fn($value, $row) => $row->categories->pluck('name')->toArray()) - ->outputFormat(fn($index, $value) => Blade::render('' . $value . '')) + ->data(fn ($value, $row) => $row->categories->pluck('name')->toArray()) + ->outputFormat(fn ($index, $value) => Blade::render(''.$value.'')) ->flexRow(['class' => 'gap-2 flex-wrap']), Column::make('Merek', 'brand.name')->searchable()->sortable(), Column::make('Concentration', 'concentration') - ->label(fn($row, $column) => Blade::render('' . $row->concentration->label() . '')) + ->label(fn ($row, $column) => Blade::render(''.$row->concentration->label().'')) ->html(), Column::make('Harga Beli', 'cost_price') @@ -79,15 +79,15 @@ public function columns(): array ->hideIf(! auth()->user()->hasRole(['Developer', 'Owner'])), Column::make('Harga Jual', 'sale_price') - ->label(fn($row, $column) => currency($row->sale_price, 'Rp')) + ->label(fn ($row, $column) => currency($row->sale_price, 'Rp')) ->searchable() ->sortable(), ArrayColumn::make('Outlet') ->data( - fn($value, $row) => $row->outlets - ->filter(fn($outlet) => auth()->user()->outlets->pluck('id')->contains($outlet->id)) - ->map(fn($outlet) => [ + fn ($value, $row) => $row->outlets + ->filter(fn ($outlet) => auth()->user()->outlets->pluck('id')->contains($outlet->id)) + ->map(fn ($outlet) => [ 'id' => $outlet->hash, 'perfume_id' => $row->hash, 'name' => $outlet->name, @@ -99,7 +99,7 @@ public function columns(): array $canAudit = auth()->user()->can('audit perfume'); $tag = $canAudit ? 'div' : 'a'; - $attrs = $canAudit ? '' : 'href="' . $route . '" wire:navigate'; + $attrs = $canAudit ? '' : 'href="'.$route.'" wire:navigate'; return Blade::render(" <{$tag} {$attrs} @@ -159,7 +159,7 @@ public function builder(): Builder ]) ->whereHas( 'outlets', - fn($q) => $q->whereIn('outlets.id', auth()->user()->outlets()->pluck('outlets.id')) + fn ($q) => $q->whereIn('outlets.id', auth()->user()->outlets()->pluck('outlets.id')) ); } } diff --git a/app/Livewire/Datatable/Studio/Catalog/ProductsTable.php b/app/Livewire/Datatable/Studio/Catalog/ProductsTable.php index 5d93fd0..fc49900 100644 --- a/app/Livewire/Datatable/Studio/Catalog/ProductsTable.php +++ b/app/Livewire/Datatable/Studio/Catalog/ProductsTable.php @@ -68,15 +68,15 @@ public function columns(): array ->hideIf(! auth()->user()->hasRole(['Developer', 'Owner'])), Column::make('Harga Jual', 'sale_price') - ->label(fn($row, $column) => currency($row->sale_price, 'Rp')) + ->label(fn ($row, $column) => currency($row->sale_price, 'Rp')) ->searchable() ->sortable(), ArrayColumn::make('Outlet') ->data( - fn($value, $row) => $row->outlets - ->filter(fn($outlet) => auth()->user()->outlets->pluck('id')->contains($outlet->id)) - ->map(fn($outlet) => [ + fn ($value, $row) => $row->outlets + ->filter(fn ($outlet) => auth()->user()->outlets->pluck('id')->contains($outlet->id)) + ->map(fn ($outlet) => [ 'id' => $outlet->hash, 'product_id' => $row->hash, 'name' => $outlet->name, @@ -88,7 +88,7 @@ public function columns(): array $canAudit = auth()->user()->can('audit product'); $tag = $canAudit ? 'div' : 'a'; - $attrs = $canAudit ? '' : 'href="' . $route . '" wire:navigate'; + $attrs = $canAudit ? '' : 'href="'.$route.'" wire:navigate'; return Blade::render(" <{$tag} {$attrs} @@ -134,7 +134,7 @@ public function builder(): Builder ->with('outlets') ->whereHas( 'outlets', - fn($q) => $q->whereIn('outlets.id', auth()->user()->outlets()->pluck('outlets.id')) + fn ($q) => $q->whereIn('outlets.id', auth()->user()->outlets()->pluck('outlets.id')) ); } } diff --git a/app/Livewire/Datatable/Studio/Manage/PriceRequestsTable.php b/app/Livewire/Datatable/Studio/Manage/PriceRequestsTable.php index eb9252d..0b614fc 100644 --- a/app/Livewire/Datatable/Studio/Manage/PriceRequestsTable.php +++ b/app/Livewire/Datatable/Studio/Manage/PriceRequestsTable.php @@ -14,7 +14,7 @@ class PriceRequestsTable extends DataTableComponent { - use WithConfiguration, WithPrependColumn, WithAppendColumn; + use WithAppendColumn, WithConfiguration, WithPrependColumn; protected $model = PriceRequest::class; @@ -24,11 +24,11 @@ public function columns(): array Column::make('Pemohon', 'user.employee.full_name')->searchable(), Column::make('module', 'module') - ->format(fn($row) => ucfirst($row)) + ->format(fn ($row) => ucfirst($row)) ->searchable(), Column::make('Status', 'status') - ->label(fn($row, $column) => Blade::render('' . $row->status->label() . '')) + ->label(fn ($row, $column) => Blade::render(''.$row->status->label().'')) ->html(), Column::make('Tanggal') diff --git a/app/Livewire/Studio/Manage/PriceRequest.php b/app/Livewire/Studio/Manage/PriceRequest.php index 60a6de6..639b597 100644 --- a/app/Livewire/Studio/Manage/PriceRequest.php +++ b/app/Livewire/Studio/Manage/PriceRequest.php @@ -4,7 +4,6 @@ use App\Enums\PriceRequestStatus; use App\Jobs\StorePushNotification; -use App\Livewire\Datatable\Studio\Catalog\PerfumesTable; use App\Models\PriceRequest as PriceRequestModel; use App\Models\PushNotification; use App\Traits\Notification\WithSubscribeNotification; @@ -26,14 +25,14 @@ public function approve(PriceRequestModel $priceRequest) $priceRequest->update([ 'status' => PriceRequestStatus::APPROVED->value, - 'finalized_at' => now() + 'finalized_at' => now(), ]); StorePushNotification::dispatch( PushNotification::where('user_id', $priceRequest->user_id)->get(), [ 'title' => 'Permintaan Harga Disetujui ✅', - 'body' => "Selamat! Permintaan untuk melihat harga beli {$priceRequest->module} sudah disetujui 🎉", + 'body' => "Selamat! Permintaan untuk melihat harga beli {$priceRequest->module} sudah disetujui 🎉", ], ); @@ -50,14 +49,14 @@ public function reject(PriceRequestModel $priceRequest) $priceRequest->update([ 'status' => PriceRequestStatus::REJECTED->value, - 'finalized_at' => now() + 'finalized_at' => now(), ]); StorePushNotification::dispatch( PushNotification::where('user_id', $priceRequest->user_id)->get(), [ 'title' => 'Permintaan Harga Ditolak ❌', - 'body' => "Maaf, permintaan untuk melihat harga beli {$priceRequest->module} tidak dapat dipenuhi 🙏", + 'body' => "Maaf, permintaan untuk melihat harga beli {$priceRequest->module} tidak dapat dipenuhi 🙏", ], );