Skip to content

Commit 0d61eb8

Browse files
author
Riccardo Dalla Via
authored
ADD Laravel 11 compatibility (#26)
1 parent a8f6fa8 commit 0d61eb8

35 files changed

+435
-726
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/php-cs-fixer.yml renamed to .github/workflows/fix-php-code-style-issues.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
name: Check & fix styling
1+
name: Fix PHP code style issues
22

3-
on: [push]
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
410

511
jobs:
6-
php-cs-fixer:
12+
php-code-styling:
713
runs-on: ubuntu-latest
14+
timeout-minutes: 5
815

916
steps:
1017
- name: Checkout code
1118
uses: actions/checkout@v4
1219
with:
1320
ref: ${{ github.head_ref }}
1421

15-
- name: Run PHP CS Fixer
16-
uses: docker://oskarstark/php-cs-fixer-ga
17-
with:
18-
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
1924

2025
- name: Commit changes
2126
uses: stefanzweifel/git-auto-commit-action@v5

.github/workflows/phpstan.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
- '.github/workflows/phpstan.yml'
9+
10+
jobs:
11+
phpstan:
12+
name: phpstan
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.1'
22+
coverage: none
23+
24+
- name: Install composer dependencies
25+
uses: ramsey/composer-install@v3
26+
27+
- name: Run PHPStan
28+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/psalm.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +0,0 @@
1-
name: Psalm
2-
3-
on:
4-
push:
5-
paths:
6-
- '**.php'
7-
- 'psalm.xml.dist'
8-
9-
jobs:
10-
psalm:
11-
name: psalm
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
16-
- name: Setup PHP
17-
uses: shivammathur/setup-php@v2
18-
with:
19-
php-version: '8.0'
20-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
21-
coverage: none
22-
23-
- name: Cache composer dependencies
24-
uses: actions/cache@v4
25-
with:
26-
path: vendor
27-
key: composer-${{ hashFiles('composer.lock') }}
28-
29-
- name: Run composer install
30-
run: composer install -n --prefer-dist
31-
32-
- name: Run psalm
33-
run: ./vendor/bin/psalm --output-format=github

.github/workflows/run-tests.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.3, 8.2, 8.1, 8.0]
17-
laravel: [10.*, 9.*]
16+
php: [8.3, 8.2, 8.1]
17+
laravel: [11.*, 10.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20+
- laravel: 11.*
21+
testbench: 9.*
2022
- laravel: 10.*
2123
testbench: 8.*
22-
carbon: ^2.63
23-
- laravel: 9.*
24-
testbench: 7.*
25-
carbon: ^2.63
2624
exclude:
27-
- laravel: 10.*
28-
php: 8.0
25+
- laravel: 11.*
26+
php: 8.1
2927

3028
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
3129

@@ -47,8 +45,11 @@ jobs:
4745
4846
- name: Install dependencies
4947
run: |
50-
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
5149
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
5250
51+
- name: List Installed Dependencies
52+
run: composer show -D
53+
5354
- name: Execute tests
54-
run: vendor/bin/phpunit
55+
run: vendor/bin/pest --ci

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
.idea
2-
.php_cs
3-
.php_cs.cache
4-
.phpunit.result.cache
2+
.phpunit.cache
53
build
64
composer.lock
75
coverage
86
docs
97
phpunit.xml
10-
psalm.xml
8+
phpstan.neon
9+
testbench.yaml
1110
vendor
12-
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2023 MAIZE SRL <[email protected]>
3+
Copyright (c) 2024 MAIZE SRL <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[![Latest Version on Packagist](https://img.shields.io/packagist/v/maize-tech/laravel-searchable.svg?style=flat-square)](https://packagist.org/packages/maize-tech/laravel-searchable)
1212
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-searchable/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/maize-tech/laravel-searchable/actions?query=workflow%3Arun-tests+branch%3Amain)
13-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-searchable/php-cs-fixer.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/maize-tech/laravel-searchable/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
13+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-searchable/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/maize-tech/laravel-searchable/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
1414
[![Total Downloads](https://img.shields.io/packagist/dt/maize-tech/laravel-searchable.svg?style=flat-square)](https://packagist.org/packages/maize-tech/laravel-searchable)
1515

1616
Easily add weighted searches through model attributes and relationships.

composer.json

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.0",
20-
"illuminate/database": "^9.0|^10.0",
21-
"illuminate/support": "^9.0|^10.0",
19+
"php": "^8.1",
20+
"illuminate/database": "^10.0|^11.0",
21+
"illuminate/support": "^10.0|^11.0",
2222
"spatie/laravel-package-tools": "^1.14.1"
2323
},
2424
"require-dev": {
25-
"friendsofphp/php-cs-fixer": "^3.4",
26-
"orchestra/testbench": "^7.0|^8.0",
27-
"phpunit/phpunit": "^9.5",
28-
"vimeo/psalm": "^4.20"
25+
"larastan/larastan": "^2.9",
26+
"laravel/pint": "^1.14",
27+
"orchestra/testbench": "^8.0|^9.0",
28+
"pestphp/pest": "^2.34",
29+
"pestphp/pest-plugin-arch": "^2.7",
30+
"pestphp/pest-plugin-laravel": "^2.3",
31+
"phpstan/extension-installer": "^1.3",
32+
"phpstan/phpstan-deprecation-rules": "^1.1",
33+
"phpstan/phpstan-phpunit": "^1.3"
2934
},
3035
"autoload": {
3136
"psr-4": {
@@ -39,13 +44,17 @@
3944
}
4045
},
4146
"scripts": {
42-
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
43-
"psalm": "vendor/bin/psalm",
44-
"test": "vendor/bin/phpunit --colors=always",
45-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
47+
"analyse": "vendor/bin/phpstan analyse",
48+
"format": "vendor/bin/pint",
49+
"test": "vendor/bin/pest",
50+
"test-coverage": "vendor/bin/pest --coverage"
4651
},
4752
"config": {
48-
"sort-packages": true
53+
"sort-packages": true,
54+
"allow-plugins": {
55+
"pestphp/pest-plugin": true,
56+
"phpstan/extension-installer": true
57+
}
4958
},
5059
"extra": {
5160
"laravel": {

0 commit comments

Comments
 (0)