Skip to content

Commit 1d3379f

Browse files
committed
feat: add laravel 11 support
1 parent dc93c0e commit 1d3379f

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

.github/workflows/pint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PHP Linting
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
phplint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: "laravel-pint"
13+
uses: aglipanci/laravel-pint-action@2.0.0
14+
with:
15+
preset: laravel
16+
verboseMode: true
17+
- uses: stefanzweifel/git-auto-commit-action@v5
18+
with:
19+
commit_message: "fix: pint"
20+

composer.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^8.1",
19-
"yajra/laravel-datatables-oracle": "^10",
20-
"yajra/laravel-datatables-html": "^10",
21-
"illuminate/console": "^10"
18+
"php": "^8.2",
19+
"yajra/laravel-datatables-oracle": "^11",
20+
"yajra/laravel-datatables-html": "^11",
21+
"illuminate/console": "^11"
2222
},
2323
"require-dev": {
24-
"maatwebsite/excel": "^3.1.46",
2524
"larastan/larastan": "^2.4",
26-
"orchestra/testbench": "^8",
27-
"rap2hpoutre/fast-excel": "^5.1",
28-
"barryvdh/laravel-snappy": "^1.0.1"
25+
"orchestra/testbench": "^9"
2926
},
3027
"autoload": {
3128
"psr-4": {
@@ -39,7 +36,7 @@
3936
},
4037
"extra": {
4138
"branch-alias": {
42-
"dev-master": "10.0-dev"
39+
"dev-master": "11.0-dev"
4340
},
4441
"laravel": {
4542
"providers": [

tests/DataTableServiceTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Foundation\Testing\DatabaseTransactions;
66
use Illuminate\Http\Response;
77
use Illuminate\Support\Collection;
8+
use PHPUnit\Framework\Attributes\Test;
89
use Symfony\Component\HttpFoundation\BinaryFileResponse;
910
use Yajra\DataTables\Buttons\Tests\DataTables\UsersDataTable;
1011
use Yajra\DataTables\Buttons\Tests\Models\User;
@@ -14,7 +15,7 @@ class DataTableServiceTest extends TestCase
1415
{
1516
use DatabaseTransactions;
1617

17-
/** @test */
18+
#[Test]
1819
public function it_can_handle_ajax_request(): void
1920
{
2021
$response = $this->getAjax('/users');
@@ -26,7 +27,7 @@ public function it_can_handle_ajax_request(): void
2627
]);
2728
}
2829

29-
/** @test */
30+
#[Test]
3031
public function it_returns_view_on_normal_get_request(): void
3132
{
3233
$response = $this->get('users');
@@ -35,31 +36,31 @@ public function it_returns_view_on_normal_get_request(): void
3536
$response->assertSeeText('LaravelDataTables');
3637
}
3738

38-
/** @test */
39+
#[Test]
3940
public function it_can_return_a_csv_file(): void
4041
{
4142
$response = $this->get('users?action=csv');
4243

4344
$this->assertInstanceOf(BinaryFileResponse::class, $response->baseResponse);
4445
}
4546

46-
/** @test */
47+
#[Test]
4748
public function it_can_return_a_xls_file(): void
4849
{
4950
$response = $this->get('users?action=excel');
5051

5152
$this->assertInstanceOf(BinaryFileResponse::class, $response->baseResponse);
5253
}
5354

54-
/** @test */
55+
#[Test]
5556
public function it_can_return_a_pdf_file(): void
5657
{
5758
$response = $this->get('users?action=pdf');
5859

5960
$this->assertInstanceOf(Response::class, $response->baseResponse);
6061
}
6162

62-
/** @test */
63+
#[Test]
6364
public function it_allows_before_response_callback(): void
6465
{
6566
$response = $this->getAjax('users/before');
@@ -69,7 +70,7 @@ public function it_allows_before_response_callback(): void
6970
$this->assertEquals($row['name'].'X', $row['nameX']);
7071
}
7172

72-
/** @test */
73+
#[Test]
7374
public function it_allows_response_callback(): void
7475
{
7576
$response = $this->getAjax('users/response');

tests/DataTables/UsersDataTable.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
class UsersDataTable extends DataTable
1212
{
13-
/**
14-
* @throws \Yajra\DataTables\Exceptions\Exception
15-
*/
1613
public function dataTable(Builder $query): EloquentDataTable
1714
{
1815
return (new EloquentDataTable($query))

tests/TestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ protected function getPackageProviders($app): array
111111
DataTablesServiceProvider::class,
112112
ButtonsServiceProvider::class,
113113
HtmlServiceProvider::class,
114-
ServiceProvider::class,
115114
];
116115
}
117116

0 commit comments

Comments
 (0)