From c8b2b32691244390fd043ad3c41eb1eb3a9a76ff Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Sat, 1 Nov 2025 16:42:47 +0700 Subject: [PATCH] refactor(audit): menghilangkan nama outlet di card sebagai gantinya menjadi page title --- app/Livewire/Studio/Catalog/Bottle/Audit.php | 5 ++--- app/Livewire/Studio/Catalog/Perfume/Audit.php | 5 ++--- app/Livewire/Studio/Catalog/Product/Audit.php | 5 ++--- resources/views/components/partials/audit.blade.php | 7 +++---- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/Livewire/Studio/Catalog/Bottle/Audit.php b/app/Livewire/Studio/Catalog/Bottle/Audit.php index e8f6001..9f9cf44 100644 --- a/app/Livewire/Studio/Catalog/Bottle/Audit.php +++ b/app/Livewire/Studio/Catalog/Bottle/Audit.php @@ -18,19 +18,18 @@ class Audit extends Component public function mount(Outlet $outlet, Bottle $bottle) { - $this->label = $bottle->name; + $this->label = $bottle->name.' di '.$outlet->name; $this->activityLogs = Activity::where('subject_type', get_class($bottle)) ->where('subject_id', $bottle->id) ->where('properties->outlet_id', $outlet->id) ->latest() ->get() - ->map(function (Activity $activity) use ($outlet) { + ->map(function (Activity $activity) { return [ 'log_name' => $activity->log_name, 'created_at' => $activity->created_at, - 'outlet' => $outlet->name, 'event' => [ 'label' => $activity->event, 'color' => AuditStockStatus::from($activity->event)->color(), diff --git a/app/Livewire/Studio/Catalog/Perfume/Audit.php b/app/Livewire/Studio/Catalog/Perfume/Audit.php index 96cf59c..8dfb116 100644 --- a/app/Livewire/Studio/Catalog/Perfume/Audit.php +++ b/app/Livewire/Studio/Catalog/Perfume/Audit.php @@ -18,19 +18,18 @@ class Audit extends Component public function mount(Outlet $outlet, Perfume $perfume) { - $this->label = $perfume->name; + $this->label = $perfume->name.' di '.$outlet->name; $this->activityLogs = Activity::where('subject_type', get_class($perfume)) ->where('subject_id', $perfume->id) ->where('properties->outlet_id', $outlet->id) ->latest() ->get() - ->map(function (Activity $activity) use ($outlet) { + ->map(function (Activity $activity) { return [ 'log_name' => $activity->log_name, 'created_at' => $activity->created_at, - 'outlet' => $outlet->name, 'event' => [ 'label' => $activity->event, 'color' => AuditStockStatus::from($activity->event)->color(), diff --git a/app/Livewire/Studio/Catalog/Product/Audit.php b/app/Livewire/Studio/Catalog/Product/Audit.php index 3bd81ce..76ee5fb 100644 --- a/app/Livewire/Studio/Catalog/Product/Audit.php +++ b/app/Livewire/Studio/Catalog/Product/Audit.php @@ -18,19 +18,18 @@ class Audit extends Component public function mount(Outlet $outlet, Product $product) { - $this->label = $product->name; + $this->label = $product->name.' di '.$outlet->name; $this->activityLogs = Activity::where('subject_type', get_class($product)) ->where('subject_id', $product->id) ->where('properties->outlet_id', $outlet->id) ->latest() ->get() - ->map(function (Activity $activity) use ($outlet) { + ->map(function (Activity $activity) { return [ 'log_name' => $activity->log_name, 'created_at' => $activity->created_at, - 'outlet' => $outlet->name, 'event' => [ 'label' => $activity->event, 'color' => AuditStockStatus::from($activity->event)->color(), diff --git a/resources/views/components/partials/audit.blade.php b/resources/views/components/partials/audit.blade.php index 8376813..4b19237 100644 --- a/resources/views/components/partials/audit.blade.php +++ b/resources/views/components/partials/audit.blade.php @@ -14,10 +14,9 @@ @forelse ($activityLogs as $log)
-
{{ $log['log_name'] }}
-
{{ $log['created_at'] }}
-
{{ $log['outlet'] }}
-
{{ $log['user'] }}
+
{{ $log['log_name'] }}
+
{{ $log['created_at'] }}
+
{{ $log['user'] }}