Skip to content

Commit de8d373

Browse files
committed
feat: add support for Laravel 12
1 parent 1f74f38 commit de8d373

15 files changed

+164
-52
lines changed

.editorconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
; This file is for unifying the coding style for different editors and IDEs.
2-
; More information at https://editorconfig.org
3-
41
root = true
52

63
[*]
74
charset = utf-8
85
end_of_line = lf
9-
insert_final_newline = true
106
indent_size = 4
117
indent_style = space
8+
insert_final_newline = true
129
trim_trailing_whitespace = true
1310

1411
[*.md]

.gitattributes

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
* text=auto
2-
31
# Path-based git attributes
42
# https://git-scm.com/docs/gitattributes
3+
* text=auto
54

65
# Ignore all test and documentation with "export-ignore".
7-
/.editorconfig export-ignore
8-
/.gitattributes export-ignore
9-
/.github export-ignore
10-
/.gitignore export-ignore
11-
/docs export-ignore
12-
/phpstan.neon.dist export-ignore
13-
/phpunit.xml.dist export-ignore
14-
/tests export-ignore
6+
/.github export-ignore
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/phpunit.xml.dist export-ignore
10+
/art export-ignore
11+
/docs export-ignore
12+
/tests export-ignore
13+
/.editorconfig export-ignore
14+
/.php_cs.dist.php export-ignore
15+
/psalm.xml export-ignore
16+
/psalm.xml.dist export-ignore
17+
/testbench.yaml export-ignore
18+
/UPGRADING.md export-ignore
19+
/phpstan.neon.dist export-ignore
20+
/phpstan-baseline.neon export-ignore
21+
/docker export-ignore
22+
/docker-compose.yml export-ignore
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Dependabot Auto-Merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v2
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Auto-merge Dependabot PRs for semver-minor updates
21+
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
22+
run: gh pr merge --auto --merge "$PR_URL"
23+
env:
24+
PR_URL: ${{ github.event.pull_request.html_url }}
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Auto-merge Dependabot PRs for semver-patch updates
28+
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
29+
run: gh pr merge --auto --merge "$PR_URL"
30+
env:
31+
PR_URL: ${{ github.event.pull_request.html_url }}
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/static.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,32 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.2'
19+
php-version: '8.3'
2020
coverage: none
2121

2222
- name: Install composer dependencies
23-
uses: ramsey/composer-install@v2
23+
uses: ramsey/composer-install@v3
2424

2525
- name: Run PHPStan
2626
run: composer test:types
27+
28+
ecs:
29+
name: ECS
30+
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: '8.3'
41+
coverage: none
42+
43+
- name: Install Dependencies
44+
run: composer update --prefer-dist --no-interaction --no-progress --ansi
45+
46+
- name: Run ECS
47+
run: composer test:style

.github/workflows/tests.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
name: Tests
22

33
on:
4-
pull_request:
54
push:
6-
branches:
7-
- master
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
88

99
jobs:
10-
php-tests:
11-
name: Testing on PHP ${{ matrix.php }}
12-
runs-on: ubuntu-latest
10+
test:
11+
runs-on: ${{ matrix.os }}
1312
strategy:
13+
fail-fast: true
1414
matrix:
15-
php: [8.2, 8.3, 8.4]
16-
steps:
15+
os: [ubuntu-latest]
16+
php: [8.4, 8.3]
17+
laravel: [12.*, 11.*]
18+
stability: [prefer-lowest, prefer-stable]
19+
include:
20+
- laravel: 12.*
21+
testbench: 10.*
22+
- laravel: 11.*
23+
testbench: 9.*
1724

18-
- name: Checkout
25+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
26+
27+
steps:
28+
- name: Checkout code
1929
uses: actions/checkout@v4
2030

2131
- name: Setup PHP
@@ -24,13 +34,15 @@ jobs:
2434
php-version: ${{ matrix.php }}
2535
coverage: none
2636

27-
- name: Setup Problem Matches
37+
- name: Setup problem matchers
2838
run: |
2939
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
3040
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
3141
32-
- name: Install PHP dependencies
33-
run: composer update --no-interaction --no-progress --ansi
42+
- name: Install dependencies
43+
run: |
44+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --ansi
45+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ansi
3446
35-
- name: Unit Tests
36-
run: composer test --ansi
47+
- name: Execute tests
48+
run: composer test:unit

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
/.idea
12
/build
23
/vendor
3-
/.phpunit.cache
4-
/.php-cs-fixer.cache
4+
/.php_cs.cache
55
/composer.lock
66
/phpunit.xml
7+
/phpstan.neon
8+
.php_cs
9+
.php_cs.cache
10+
.phpunit.cache
11+
.php-cs-fixer.cache
12+
coverage
13+
docs
14+
node_modules
15+
testbench.yaml

composer.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
"description": "Adds Foggy support in Laravel",
44
"license": "MIT",
55
"require": {
6-
"php": "^8.2",
6+
"php": "^8.3",
77
"doctrine/dbal": "^3.5.1 || ^4.0",
8-
"illuminate/console": "^11.0",
9-
"illuminate/database": "^11.0",
10-
"illuminate/support": "^11.0",
8+
"illuminate/console": "^11.0 || ^12.0",
9+
"illuminate/database": "^11.0 || ^12.0",
10+
"illuminate/support": "^11.0 || ^12.0",
1111
"thecodingmachine/safe": "^2.5 || ^3.0",
1212
"worksome/foggy": "^0.6"
1313
},
1414
"require-dev": {
15-
"orchestra/testbench": "^8.21 || ^9.0",
15+
"nunomaduro/collision": "^7.10 || ^8.1.1",
16+
"orchestra/testbench": "^9.12 || ^10.1",
1617
"pestphp/pest": "^3.7",
1718
"pestphp/pest-plugin-laravel": "^3.1",
18-
"worksome/coding-style": "^3.1"
19+
"worksome/coding-style": "^3.2"
1920
},
2021
"autoload": {
2122
"psr-4": {
@@ -29,9 +30,14 @@
2930
},
3031
"scripts": {
3132
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
33+
"lint": "vendor/bin/ecs --fix",
3234
"test:unit": "vendor/bin/pest -p",
35+
"test:types": "vendor/bin/phpstan analyse",
36+
"test:style": "vendor/bin/ecs",
3337
"test:coverage": "vendor/bin/pest -p --coverage",
3438
"test": [
39+
"@test:style",
40+
"@test:types",
3541
"@test:unit"
3642
]
3743
},

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
php:
3+
build: ./docker
4+
volumes:
5+
- .:/var/www/html
6+
environment:
7+
- XDEBUG_MODE=${XDEBUG_MODE:-off}
8+
- XDEBUG_CONFIG=${XDEBUG_CONFIG:-client_host=host.docker.internal}
9+
composer:
10+
build: ./docker
11+
entrypoint: ["composer"]
12+
volumes:
13+
- .:/var/www/html

docker/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM php:8.3-cli-alpine
2+
3+
RUN apk add --no-cache $PHPIZE_DEPS linux-headers
4+
RUN pecl install xdebug
5+
RUN docker-php-ext-enable xdebug
6+
7+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
8+
9+
WORKDIR /var/www/html
10+
11+
ENTRYPOINT ["php"]

ecs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Symplify\EasyCodingStandard\Config\ECSConfig;
66
use Worksome\CodingStyle\WorksomeEcsConfig;
77

8-
98
return static function (ECSConfig $ecsConfig): void {
109
$ecsConfig->paths([
1110
__DIR__ . '/src',

0 commit comments

Comments
 (0)