Skip to content

Commit 43ca09f

Browse files
authored
Merge pull request #3274 from yajra/laravel-13-support
feat: add Laravel 13 support
2 parents 1e4251f + 228acef commit 43ca09f

24 files changed

+117
-198
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: true
1919
matrix:
20-
php: [ 8.2, 8.3, 8.4, 8.5 ]
20+
php: [ 8.3, 8.4, 8.5 ]
2121
stability: [ prefer-stable ]
2222

2323
name: PHP ${{ matrix.php }} - STABILITY ${{ matrix.stability }}

.github/workflows/pint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ on:
33
push:
44
branches:
55
- master
6-
- 11.x
6+
- '*.x'
7+
78
jobs:
89
phplint:
910
runs-on: ubuntu-latest

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup PHP
3131
uses: shivammathur/setup-php@v2
3232
with:
33-
php-version: 8.2
33+
php-version: 8.3
3434
tools: composer:v2
3535
coverage: none
3636

CHANGELOG.md

Lines changed: 3 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,5 @@
1-
# [12.7.0](https://github.com/yajra/laravel-datatables/compare/v12.6.3...v12.7.0) (2026-02-20)
1+
### v13.0.0 - 2026-03-18
22

3+
- feat: Laravel 13 Compatibility #3274
34

4-
### Bug Fixes
5-
6-
* address phpstan and fork phplint checkout ([7c416ef](https://github.com/yajra/laravel-datatables/commit/7c416ef38347d23bc52eca5439f0889c4e493440))
7-
* allow editing DT_RowIndex via editColumn ([fd161f0](https://github.com/yajra/laravel-datatables/commit/fd161f019f54fc13995bd4f2664f12e4f8aa3317))
8-
* cast index column config for static analysis ([468f44c](https://github.com/yajra/laravel-datatables/commit/468f44ce845a4a40734eaaca9d5753095ced013a))
9-
* **ci:** support fork PR checkout in pint workflow ([fe30c00](https://github.com/yajra/laravel-datatables/commit/fe30c005f15eccc5c1d5314199f35740a5ed2192))
10-
* **ci:** update memcached action to v8 ([c9e7f15](https://github.com/yajra/laravel-datatables/commit/c9e7f15ea3833311664c3c818e1f29c2c23918f9))
11-
12-
13-
### Features
14-
15-
* support LengthAwarePaginator engine ([b8f9bb3](https://github.com/yajra/laravel-datatables/commit/b8f9bb33189d069d81901af59c73057aa8d84abd))
16-
17-
## [12.6.3](https://github.com/yajra/laravel-datatables/compare/v12.6.2...v12.6.3) (2025-12-09)
18-
19-
20-
### Bug Fixes
21-
22-
* [#3266](https://github.com/yajra/laravel-datatables/issues/3266), replace ConfigRepository's type helper methods with get() ([#3267](https://github.com/yajra/laravel-datatables/issues/3267)) ([b9e5f78](https://github.com/yajra/laravel-datatables/commit/b9e5f785851a21779b0c88c2b0eb5c02e9714a76))
23-
* pint :robot: ([e74e6ce](https://github.com/yajra/laravel-datatables/commit/e74e6cea55d552dd4ac66483c73cc0029050f52e))
24-
25-
## [12.6.2](https://github.com/yajra/laravel-datatables/compare/v12.6.1...v12.6.2) (2025-12-02)
26-
27-
28-
### Bug Fixes
29-
30-
* pint :robot: ([41a22c7](https://github.com/yajra/laravel-datatables/commit/41a22c7b52f4d154e6ee8b9c0834c51d20001c00))
31-
* resolve PHPStan array key type errors ([3b5e668](https://github.com/yajra/laravel-datatables/commit/3b5e66832fd4c708c2fc6c4afffc12815c43b248))
32-
33-
## [12.6.1](https://github.com/yajra/laravel-datatables/compare/v12.6.0...v12.6.1) (2025-10-11)
34-
35-
36-
### Bug Fixes
37-
38-
* value when mask uses "/" ([c771900](https://github.com/yajra/laravel-datatables/commit/c77190030c713e5b64c433bd161d9f33a210f22b))
39-
40-
# [12.6.0](https://github.com/yajra/laravel-datatables/compare/v12.5.1...v12.6.0) (2025-10-08)
41-
42-
43-
### Bug Fixes
44-
45-
* replace unsafe eval() with Blade::render() in compileBlade ([7f46d58](https://github.com/yajra/laravel-datatables/commit/7f46d5872b0324493c28ecc8d848c182e88f30e0))
46-
47-
48-
### Features
49-
50-
* add __isset() method to Request for attribute existence check ([33f44d4](https://github.com/yajra/laravel-datatables/commit/33f44d42d284d6ea0a054de81ad5a57c3050867d))
51-
52-
# Laravel DataTables
53-
54-
## CHANGELOG
55-
56-
### [Unreleased]
57-
58-
### v12.5.1 - 2025-10-02
59-
60-
- fix: ambiguous column in columnControlSearch() method #3252
61-
62-
### v12.5.0 - 2025-10-01
63-
64-
- feat: server-side column control #3251
65-
- fix: https://github.com/yajra/laravel-datatables/issues/3250
66-
67-
### v12.4.2 - 2025-09-09
68-
69-
- fix: remove @internal annotation from orderColumn() method #3248
70-
71-
### v12.4.1 - 2025-08-29
72-
73-
- fix: request handling with playwright / pest 4 #3247
74-
75-
### v12.4.0 - 2025-06-15
76-
77-
- feat: add min search length control #3242
78-
- fix: #3241
79-
80-
### v12.3.1 - 2025-06-10
81-
82-
- fix: support for array notation #3243
83-
84-
### v12.3.0 - 2025-05-17
85-
86-
- feat: add option to enable alias on relation tables #3234
87-
- tests: Add tests to cover prefix detection #3239
88-
- fix: https://github.com/yajra/laravel-datatables/pull/1782
89-
90-
### v12.2.1 - 2025-05-09
91-
92-
- fix: improve prefix detection #3238
93-
- fix: #3237
94-
95-
### v12.2.0 - 2025-05-08
96-
97-
- feat: add relation resolver param to order callback #3232
98-
- fix: improve column alias detection #3236
99-
- fix: #3235
100-
101-
### v12.1.2 - 2025-05-07
102-
103-
- fix: prevent prefixing null/empty string #3233
104-
105-
### v12.1.1 - 2025-05-05
106-
107-
- fix: prevent ambiguous column names #3227
108-
109-
### v12.1.0 - 2025-04-28
110-
111-
- feat: add relation resolver param to filter callbacks #3229
112-
113-
### v12.0.1 - 2025-04-07
114-
115-
- fix: query results improvements #3224
116-
117-
### v12.0.0 - 2025-02-26
118-
119-
- feat: Laravel v12 Compatibility #3217
120-
- fix: prevent duplicate table name errors #3216
121-
122-
[Unreleased]: https://github.com/yajra/laravel-datatables/compare/v12.0.0...master
5+
[Unreleased]: https://github.com/yajra/laravel-datatables/compare/v13.0.0...master

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^8.2",
19-
"illuminate/database": "^12",
20-
"illuminate/filesystem": "^12",
21-
"illuminate/http": "^12",
22-
"illuminate/support": "^12",
23-
"illuminate/view": "^12"
18+
"php": "^8.3",
19+
"illuminate/database": "^13",
20+
"illuminate/filesystem": "^13",
21+
"illuminate/http": "^13",
22+
"illuminate/support": "^13",
23+
"illuminate/view": "^13"
2424
},
2525
"require-dev": {
2626
"algolia/algoliasearch-client-php": "^3.4.1",
2727
"larastan/larastan": "^3.1.0",
2828
"laravel/pint": "^1.14",
2929
"laravel/scout": "^10.8.3",
3030
"meilisearch/meilisearch-php": "^1.6.1",
31-
"orchestra/testbench": "^10",
31+
"orchestra/testbench": "^11",
3232
"rector/rector": "^2.0"
3333
},
3434
"suggest": {
@@ -53,7 +53,7 @@
5353
},
5454
"extra": {
5555
"branch-alias": {
56-
"dev-master": "12.x-dev"
56+
"dev-master": "13.x-dev"
5757
},
5858
"laravel": {
5959
"providers": [

src/ApiResourceDataTable.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Yajra\DataTables;
44

55
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
6+
use Illuminate\Support\Collection;
67

78
class ApiResourceDataTable extends CollectionDataTable
89
{
@@ -20,7 +21,7 @@ public static function canCreate($source)
2021
/**
2122
* Factory method, create and return an instance for the DataTable engine.
2223
*
23-
* @param \Illuminate\Http\Resources\Json\AnonymousResourceCollection<array-key, array>|array $source
24+
* @param AnonymousResourceCollection<array-key, array>|array $source
2425
* @return ApiResourceDataTable|DataTableAbstract
2526
*/
2627
public static function create($source)
@@ -31,11 +32,11 @@ public static function create($source)
3132
/**
3233
* CollectionEngine constructor.
3334
*
34-
* @param \Illuminate\Http\Resources\Json\AnonymousResourceCollection<array-key, array> $resourceCollection
35+
* @param AnonymousResourceCollection<array-key, array> $resourceCollection
3536
*/
3637
public function __construct(AnonymousResourceCollection $resourceCollection)
3738
{
38-
/** @var \Illuminate\Support\Collection<(int|string), array> $collection */
39+
/** @var Collection<(int|string), array> $collection */
3940
$collection = collect($resourceCollection)->pluck('resource');
4041
$this->request = app('datatables.request');
4142
$this->config = app('datatables.config');

src/CollectionDataTable.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CollectionDataTable extends DataTableAbstract
1818
/**
1919
* Collection object.
2020
*
21-
* @var \Illuminate\Support\Collection<array-key, array>
21+
* @var Collection<array-key, array>
2222
*/
2323
public Collection $original;
2424

@@ -30,7 +30,7 @@ class CollectionDataTable extends DataTableAbstract
3030
/**
3131
* CollectionEngine constructor.
3232
*
33-
* @param \Illuminate\Support\Collection<array-key, array> $collection
33+
* @param Collection<array-key, array> $collection
3434
*/
3535
public function __construct(public Collection $collection)
3636
{
@@ -62,7 +62,7 @@ public static function canCreate($source)
6262
/**
6363
* Factory method, create and return an instance for the DataTable engine.
6464
*
65-
* @param AnonymousResourceCollection|array|\Illuminate\Support\Collection<array-key, array> $source
65+
* @param AnonymousResourceCollection|array|Collection<array-key, array> $source
6666
* @return static
6767
*/
6868
public static function create($source)
@@ -140,7 +140,7 @@ public function paging(): void
140140
/**
141141
* Organizes works.
142142
*
143-
* @throws \Exception
143+
* @throws Exception
144144
*/
145145
public function make(bool $mDataSupport = true): JsonResponse
146146
{
@@ -171,7 +171,7 @@ public function make(bool $mDataSupport = true): JsonResponse
171171
/**
172172
* Get results.
173173
*
174-
* @return \Illuminate\Support\Collection<array-key, array>
174+
* @return Collection<array-key, array>
175175
*/
176176
public function results(): Collection
177177
{

src/Contracts/DataTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface DataTable
1010
/**
1111
* Get results.
1212
*
13-
* @return \Illuminate\Support\Collection<int, \stdClass>|\Illuminate\Support\Collection<array-key, array>
13+
* @return Collection<int, \stdClass>|Collection<array-key, array>
1414
*/
1515
public function results(): Collection;
1616

src/Contracts/Formatter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace Yajra\DataTables\Contracts;
44

5+
use Illuminate\Database\Eloquent\Model;
6+
57
interface Formatter
68
{
79
/**
8-
* @param array|\Illuminate\Database\Eloquent\Model|object $row
10+
* @param array|Model|object $row
911
* @return string
1012
*/
1113
public function format(mixed $value, $row);

src/DataTableAbstract.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public static function create(mixed $source)
146146

147147
/**
148148
* @param string|array $columns
149-
* @param string|callable|\Yajra\DataTables\Contracts\Formatter $formatter
149+
* @param string|callable|Formatter $formatter
150150
* @return $this
151151
*/
152152
public function formatColumn($columns, $formatter): static
@@ -664,7 +664,7 @@ public function filter(callable $callback, bool $globalSearch = false): self
664664
* Convert the object to its JSON representation.
665665
*
666666
* @param int $options
667-
* @return \Illuminate\Http\JsonResponse
667+
* @return JsonResponse
668668
*/
669669
public function toJson($options = 0)
670670
{
@@ -892,7 +892,7 @@ protected function showDebugger(array $output): array
892892
/**
893893
* Return an error json response.
894894
*
895-
* @throws \Yajra\DataTables\Exceptions\Exception|\Exception
895+
* @throws Exceptions\Exception|\Exception
896896
*/
897897
protected function errorResponse(\Exception $exception): JsonResponse
898898
{
@@ -918,7 +918,7 @@ protected function errorResponse(\Exception $exception): JsonResponse
918918
/**
919919
* Get monolog/logger instance.
920920
*
921-
* @return \Psr\Log\LoggerInterface
921+
* @return LoggerInterface
922922
*/
923923
public function getLogger()
924924
{

0 commit comments

Comments
 (0)