Skip to content

Commit c18a95e

Browse files
authored
Merge pull request #5 from TappNetwork/l12-support
Laravel 12 Support, and Dependencies
2 parents 45e6fec + 6ee5c1a commit c18a95e

File tree

7 files changed

+48
-51
lines changed

7 files changed

+48
-51
lines changed

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "Fix PHP Code Styling"
33
on:
44
push:
55
paths:
6-
- '**.php'
6+
- "**.php"
77

88
permissions:
99
contents: write
@@ -22,6 +22,6 @@ jobs:
2222
uses: aglipanci/[email protected]
2323

2424
- name: Commit changes
25-
uses: stefanzweifel/git-auto-commit-action@v6
25+
uses: stefanzweifel/git-auto-commit-action@v7
2626
with:
2727
commit_message: Fix styling

.github/workflows/run-tests.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,28 @@ name: run-tests
22

33
on:
44
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
5+
paths:
6+
- "**.php"
7+
- ".github/workflows/run-tests.yml"
8+
- "phpunit.xml.dist"
9+
- "composer.json"
10+
- "composer.lock"
811

912
jobs:
1013
test:
1114
runs-on: ${{ matrix.os }}
1215
strategy:
1316
fail-fast: true
1417
matrix:
15-
os: [ubuntu-latest, windows-latest]
16-
php: [8.2, 8.3]
17-
laravel: [11.*]
18-
stability: [prefer-lowest, prefer-stable]
18+
os: [ubuntu-latest]
19+
php: [8.3, 8.4]
20+
laravel: [11.*, 12.*]
21+
stability: [prefer-stable]
1922
include:
2023
- laravel: 11.*
2124
testbench: 9.*
22-
carbon: 2.*
25+
- laravel: 12.*
26+
testbench: 10.*
2327

2428
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2529

@@ -41,7 +45,7 @@ jobs:
4145
4246
- name: Install dependencies
4347
run: |
44-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
48+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4549
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4650
4751
- name: List Installed Dependencies

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
release-notes: ${{ github.event.release.body }}
2525

2626
- name: Commit updated CHANGELOG
27-
uses: stefanzweifel/git-auto-commit-action@v6
27+
uses: stefanzweifel/git-auto-commit-action@v7
2828
with:
2929
branch: main
3030
commit_message: Update CHANGELOG

composer.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,27 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^8.1",
25+
"php": "^8.3",
2626
"filament/filament": "^4.0",
27-
"illuminate/contracts": "^10.0|^11.0",
27+
"illuminate/contracts": "^10.0|^11.0|^12.0",
2828
"spatie/laravel-package-tools": "^1.15.0",
2929
"spatie/laravel-medialibrary": "^11.0",
3030
"filament/spatie-laravel-media-library-plugin": "^4.0"
3131
},
3232
"require-dev": {
3333
"laravel/pint": "^1.0",
3434
"nunomaduro/collision": "^8.0",
35-
"nunomaduro/larastan": "^2.0.1",
36-
"orchestra/testbench": "^9.0",
37-
"pestphp/pest": "^2.1",
38-
"pestphp/pest-plugin-arch": "^2.0",
39-
"pestphp/pest-plugin-laravel": "^2.0",
35+
"larastan/larastan": "^3.0",
36+
"orchestra/testbench": "^9.0|^10.0",
37+
"pestphp/pest": "^4.0",
38+
"pestphp/pest-plugin-arch": "^4.0",
39+
"pestphp/pest-plugin-laravel": "^4.0",
4040
"phpstan/extension-installer": "^1.1",
41-
"phpstan/phpstan-deprecation-rules": "^1.0",
42-
"phpstan/phpstan-phpunit": "^1.0",
4341
"spatie/laravel-ray": "^1.26"
4442
},
43+
"conflict": {
44+
"phpunit/phpunit": ">=11.0,<11.1"
45+
},
4546
"autoload": {
4647
"psr-4": {
4748
"Tapp\\FilamentLibrary\\": "src/",

phpunit.xml.dist

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
5-
backupGlobals="false"
6-
bootstrap="vendor/autoload.php"
7-
colors="true"
8-
processIsolation="false"
9-
stopOnFailure="false"
10-
executionOrder="random"
11-
failOnWarning="true"
12-
failOnRisky="true"
13-
failOnEmptyTestSuite="true"
14-
beStrictAboutOutputDuringTests="true"
15-
cacheDirectory=".phpunit.cache"
16-
backupStaticProperties="false"
17-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
183
<testsuites>
19-
<testsuite name="VendorName Test Suite">
20-
<directory>tests</directory>
4+
<testsuite name="Test Suite">
5+
<directory suffix="Test.php">./tests</directory>
216
</testsuite>
227
</testsuites>
23-
<coverage>
24-
<report>
25-
<html outputDirectory="build/coverage"/>
26-
<text outputFile="build/coverage.txt"/>
27-
<clover outputFile="build/logs/clover.xml"/>
28-
</report>
29-
</coverage>
30-
<logging>
31-
<junit outputFile="build/report.junit.xml"/>
32-
</logging>
338
<source>
349
<include>
10+
<directory suffix=".php">./app</directory>
3511
<directory suffix=".php">./src</directory>
3612
</include>
3713
</source>

tests/ArchTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3-
it('will not use debugging functions')
3+
arch('will not use debugging functions')
44
->expect(['dd', 'dump', 'ray'])
55
->each->not->toBeUsed();
6+
7+
arch()->preset()->php();
8+
9+
arch()->preset()->security();
10+
11+
arch()->preset()->laravel();

tests/TestCase.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
use Filament\Tables\TablesServiceProvider;
1414
use Filament\Widgets\WidgetsServiceProvider;
1515
use Illuminate\Database\Eloquent\Factories\Factory;
16-
use Illuminate\Foundation\Testing\TestResponse;
16+
use Illuminate\Database\Schema\Blueprint;
17+
use Illuminate\Support\Facades\Schema;
18+
use Illuminate\Testing\TestResponse;
1719
use Livewire\LivewireServiceProvider;
1820
use Orchestra\Testbench\TestCase as Orchestra;
1921
use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider;
@@ -60,6 +62,14 @@ public function getEnvironmentSetUp($app)
6062
{
6163
config()->set('database.default', 'testing');
6264

65+
// Create users table first (required by library migrations)
66+
Schema::create('users', function (Blueprint $table) {
67+
$table->id();
68+
$table->string('name');
69+
$table->string('email')->unique();
70+
$table->timestamps();
71+
});
72+
6373
// Run the library migrations
6474
$migration = include __DIR__ . '/../database/migrations/2024_01_01_000000_create_library_items_table.php';
6575
$migration->up();

0 commit comments

Comments
 (0)