Skip to content

Commit da5e00e

Browse files
committed
Make bulk select checkbox use primary key
1 parent 9a53115 commit da5e00e

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1616
- Modified views to support localization better where necessary (republish views).
1717
- Alphabetize en.json
1818
- Fixed bulk actions using wrong key to select instead of $primaryKey
19+
- Make bulk select checkbox use primary key
1920

2021
## [1.3.1] - 2021-04-26
2122

resources/views/bootstrap-4/includes/table.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class="btn btn-primary btn-sm"
7676
<x-livewire-tables::bs4.table.cell>
7777
<input
7878
wire:model="selected"
79-
value="{{ $row->getKey() }}"
79+
value="{{ $row->{$primaryKey} }}"
8080
onclick="event.stopPropagation();return true;"
8181
type="checkbox"
8282
/>

resources/views/bootstrap-5/includes/table.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class="btn btn-primary btn-sm"
7777
<x-livewire-tables::bs5.table.cell class="align-middle">
7878
<input
7979
wire:model="selected"
80-
value="{{ $row->getKey() }}"
80+
value="{{ $row->{$primaryKey} }}"
8181
onclick="event.stopPropagation();return true;"
8282
class="form-check-input"
8383
type="checkbox"

resources/views/tailwind/includes/table.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
8181
<div class="flex rounded-md shadow-sm">
8282
<input
8383
wire:model="selected"
84-
value="{{ $row->getKey() }}"
84+
value="{{ $row->{$primaryKey} }}"
8585
onclick="event.stopPropagation();return true;"
8686
type="checkbox"
8787
class="rounded-md shadow-sm border-gray-300 block transition duration-150 ease-in-out sm:text-sm sm:leading-5"

0 commit comments

Comments
 (0)