From e70ffa85a15235a81724021b88398b661be978f3 Mon Sep 17 00:00:00 2001 From: erishBRBS Date: Tue, 22 Apr 2025 11:45:12 +0800 Subject: [PATCH] delete button added --- app/Livewire/Components/Table.php | 3 ++- .../views/livewire/components/table.blade.php | 8 ++++++++ .../member-management/card-member.blade.php | 1 + .../locked-account.blade.php | 1 + .../livewire/station-locator/branch.blade.php | 1 + .../livewire/station-locator/fuel.blade.php | 18 ++++++++--------- .../station-locator/station.blade.php | 20 +++++++++---------- 7 files changed, 32 insertions(+), 20 deletions(-) diff --git a/app/Livewire/Components/Table.php b/app/Livewire/Components/Table.php index 5085031..0c6f9e2 100644 --- a/app/Livewire/Components/Table.php +++ b/app/Livewire/Components/Table.php @@ -11,7 +11,8 @@ class Table extends Component public $rows = []; // Data rows for the table public $selected = []; // Selected row IDs public $addRoute = null; // Route for adding new rows (optional) - public $hasAddButton = true; // Whether the 'Add' button is shown + public $hasAddButton = true; + public $hasDelete = true; // Whether the 'Add' button is shown public $selectAll = false; // Whether 'Select All' is active public $hasCheckbox = true; // Whether checkboxes are shown for row selection public $hasActions = false; // Whether action buttons (like Edit/Delete) are shown diff --git a/resources/views/livewire/components/table.blade.php b/resources/views/livewire/components/table.blade.php index a053395..4c76e54 100644 --- a/resources/views/livewire/components/table.blade.php +++ b/resources/views/livewire/components/table.blade.php @@ -99,6 +99,14 @@ @endforelse + + @if($hasDelete) + + @endif @if ($showModal) diff --git a/resources/views/livewire/member-management/card-member.blade.php b/resources/views/livewire/member-management/card-member.blade.php index 91d650c..3484501 100644 --- a/resources/views/livewire/member-management/card-member.blade.php +++ b/resources/views/livewire/member-management/card-member.blade.php @@ -14,5 +14,6 @@ :hasCheckbox="false" :hasActions="true" :isViewPage="true" + :hasDelete="false" /> \ No newline at end of file diff --git a/resources/views/livewire/member-management/locked-account.blade.php b/resources/views/livewire/member-management/locked-account.blade.php index 5d133cf..0302d64 100644 --- a/resources/views/livewire/member-management/locked-account.blade.php +++ b/resources/views/livewire/member-management/locked-account.blade.php @@ -14,5 +14,6 @@ :hasCheckbox="false" :hasActions="true" :isViewPage="true" + :hasDelete="false" /> diff --git a/resources/views/livewire/station-locator/branch.blade.php b/resources/views/livewire/station-locator/branch.blade.php index ea578db..cffacc8 100644 --- a/resources/views/livewire/station-locator/branch.blade.php +++ b/resources/views/livewire/station-locator/branch.blade.php @@ -14,5 +14,6 @@ :hasActions="true" :isViewPage="false" :addRoute="route('branch-create')" + :hasDelete="false" /> \ No newline at end of file diff --git a/resources/views/livewire/station-locator/fuel.blade.php b/resources/views/livewire/station-locator/fuel.blade.php index c375c45..d5b1d88 100644 --- a/resources/views/livewire/station-locator/fuel.blade.php +++ b/resources/views/livewire/station-locator/fuel.blade.php @@ -1,15 +1,15 @@
-{{-- Top Nav --}} -@include('livewire.station-locator.top-nav.fuel') - 'Fuel Name', 'field' => 'fuel_name'], ['label' => 'Date Created', 'field' => 'date_created'], ['label' => 'Date Modified', 'field' => 'date_modified'], ]" - :rows="$fuels" - :hasActions="true" - :isViewPage="false" - :addRoute="route('fuel-create')" - /> + :rows="$fuels" + :hasActions="true" + :isViewPage="false" + :addRoute="route('fuel-create')" + :hasDelete="false" />
\ No newline at end of file diff --git a/resources/views/livewire/station-locator/station.blade.php b/resources/views/livewire/station-locator/station.blade.php index aaf5420..ff5b74c 100644 --- a/resources/views/livewire/station-locator/station.blade.php +++ b/resources/views/livewire/station-locator/station.blade.php @@ -1,8 +1,8 @@
-{{-- Top Nav --}} -@include('livewire.station-locator.top-nav.station') - 'Station Code', 'field' => 'station_code'], ['label' => 'Station Name', 'field' => 'station_name'], ['label' => 'Branch Name', 'field' => 'branch_name'], @@ -11,9 +11,9 @@ ['label' => 'Modified By', 'field' => 'modified_by'], ['label' => 'Date Modified', 'field' => 'date_modified'], ]" - :rows="$stations" - :hasActions="true" - :isViewPage="false" - :addRoute="route('station-create')" - /> -
+ :rows="$stations" + :hasActions="true" + :isViewPage="false" + :addRoute="route('station-create')" + :hasDelete="false" /> + \ No newline at end of file