Skip to content

Commit 3482038

Browse files
authored
Merge pull request #287 from rappasoft/develop
v1.7.0
2 parents ecc21d1 + 398d7d2 commit 3482038

22 files changed

+185
-66
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
44

55
## [Unreleased]
66

7+
## [1.7.0] - 2021-05-18
8+
9+
### Added
10+
11+
- [Ability to turn off filter dropdown](https://github.com/rappasoft/laravel-livewire-tables/pull/285)
12+
13+
### Changed
14+
15+
- [Fix ambiguous column id when using Relation instead of Builder](https://github.com/rappasoft/laravel-livewire-tables/pull/283)
16+
- [Use column text for sorting and filter pills if no $filterNames or $sortNames exist](https://github.com/rappasoft/laravel-livewire-tables/pull/286)
17+
- [Fix tailwind pagination view](https://github.com/rappasoft/laravel-livewire-tables/pull/284)
18+
719
## [1.6.1] - 2021-05-13
820

921
### Changed
@@ -329,7 +341,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
329341

330342
- Initial release
331343

332-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.6.1...development
344+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.7.0...development
345+
[1.7.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.6.1...v1.7.0
333346
[1.6.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.6.0...v1.6.1
334347
[1.6.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.5.1...v1.6.0
335348
[1.5.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.4.0...v1.5.1

database/migrations/create_test_tables.php.stub

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,17 @@ class CreateTestTables extends Migration
3535
$table->foreign('species_id')->references('id')->on('species');
3636
$table->foreign('breed_id')->references('id')->on('breeds');
3737
});
38+
39+
Schema::create('veterinaries', function (Blueprint $table) {
40+
$table->id();
41+
$table->string('name')->index();
42+
$table->string('phone')->index();
43+
});
44+
45+
Schema::create('pet_veterinary', function (Blueprint $table) {
46+
$table->id();
47+
$table->foreignId('pet_id')->constrained();
48+
$table->foreignId('veterinary_id')->constrained();
49+
});
3850
}
3951
}

resources/views/bootstrap-4/datatable.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ class="container-fluid p-0"
2020
<div class="d-md-flex">
2121
@include('livewire-tables::bootstrap-4.includes.search')
2222

23-
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
24-
@include('livewire-tables::bootstrap-4.includes.filters')
25-
</div>
23+
@if ($showFilterDropdown)
24+
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
25+
@include('livewire-tables::bootstrap-4.includes.filters')
26+
</div>
27+
@endif
2628
</div>
2729

2830
<div class="d-md-flex">

resources/views/bootstrap-4/includes/filter-pills.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
wire:key="filter-pill-{{ $key }}"
99
class="badge badge-pill badge-info d-inline-flex align-items-center"
1010
>
11-
{{ $filterNames[$key] ?? ucwords(strtr($key, ['_' => ' ', '-' => ' '])) }}:
11+
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
1212
@if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options'))
1313
{{ $customFilters[$key]->options()[$value] ?? $value }}
1414
@else

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@if ($showPagination)
2-
@if ($paginationEnabled && $showPerPage && $rows->lastPage() > 1)
2+
@if ($paginationEnabled && $rows->lastPage() > 1)
33
<div class="row">
44
<div class="col-12 col-md-6">
55
{{ $rows->links() }}

resources/views/bootstrap-4/includes/sorting-pills.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
wire:key="sorting-pill-{{ $col }}"
88
class="badge badge-pill badge-info d-inline-flex align-items-center"
99
>
10-
<span>{{ $sortNames[$col] ?? ucwords(strtr($col, ['_' => ' ', '-' => ' '])) }}: {{ $dir === 'asc' ? ($sortDirectionNames[$col]['asc'] ?? 'A-Z') : ($sortDirectionNames[$col]['desc'] ?? 'Z-A') }}</span>
10+
<span>{{ $sortNames[$col] ?? collect($this->columns())->pluck('text', 'column')->get($col, ucwords(strtr($col, ['_' => ' ', '-' => ' ']))) }}: {{ $dir === 'asc' ? ($sortDirectionNames[$col]['asc'] ?? 'A-Z') : ($sortDirectionNames[$col]['desc'] ?? 'Z-A') }}</span>
1111

1212
<a
1313
href="#"

resources/views/bootstrap-5/datatable.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ class="container-fluid p-0"
2020
<div class="d-md-flex">
2121
@include('livewire-tables::bootstrap-5.includes.search')
2222

23-
<div class="ms-0 ms-md-3 mb-3 mb-md-0">
24-
@include('livewire-tables::bootstrap-5.includes.filters')
25-
</div>
23+
@if ($showFilterDropdown)
24+
<div class="ms-0 ms-md-3 mb-3 mb-md-0">
25+
@include('livewire-tables::bootstrap-5.includes.filters')
26+
</div>
27+
@endif
2628
</div>
2729

2830
<div class="d-md-flex">

resources/views/bootstrap-5/includes/filter-pills.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
wire:key="filter-pill-{{ $key }}"
99
class="badge rounded-pill bg-info d-inline-flex align-items-center"
1010
>
11-
{{ $filterNames[$key] ?? ucwords(strtr($key, ['_' => ' ', '-' => ' '])) }}:
11+
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
1212
@if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options'))
1313
{{ $customFilters[$key]->options()[$value] ?? $value }}
1414
@else

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@if ($showPagination)
2-
@if ($paginationEnabled && $showPerPage && $rows->lastPage() > 1)
2+
@if ($paginationEnabled && $rows->lastPage() > 1)
33
<div class="row">
44
<div class="col-12 col-md-6">
55
{{ $rows->links() }}

resources/views/bootstrap-5/includes/sorting-pills.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
wire:key="sorting-pill-{{ $col }}"
88
class="badge rounded-pill bg-info d-inline-flex align-items-center"
99
>
10-
<span>{{ $sortNames[$col] ?? ucwords(strtr($col, ['_' => ' ', '-' => ' '])) }}: {{ $dir === 'asc' ? ($sortDirectionNames[$col]['asc'] ?? 'A-Z') : ($sortDirectionNames[$col]['desc'] ?? 'Z-A') }}</span>
10+
<span>{{ $sortNames[$col] ?? collect($this->columns())->pluck('text', 'column')->get($col, ucwords(strtr($col, ['_' => ' ', '-' => ' ']))) }}: {{ $dir === 'asc' ? ($sortDirectionNames[$col]['asc'] ?? 'A-Z') : ($sortDirectionNames[$col]['desc'] ?? 'Z-A') }}</span>
1111

1212
<a
1313
href="#"

0 commit comments

Comments
 (0)