Skip to content

Commit

Permalink
L11 Support (#14)
Browse files Browse the repository at this point in the history
* Update to support Laravel 11

---------

Co-authored-by: robertmarney <robertmarney@users.noreply.github.com>
  • Loading branch information
robertmarney and robertmarney committed Feb 6, 2024
1 parent 4c920cc commit 545b84e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.4.0
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.2.0
uses: aglipanci/laravel-pint-action@2.3.0

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1, 8.0]
laravel: [10.*, 9.*]
php: [8.3, 8.2]
laravel: [11.*, 10.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*-dev
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
exclude:
- laravel: 10.*
php: 8.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The package supports unlimited starting nodes, and has been tested to 10 levels

## Requirements:

* Illuminate Collections 8+/9+/10+ (Packaged in Laravel 8+/9+/10+)
* PHP 8.0 / 8.1 / 8.2
* Illuminate Collections 8+/9+/10+/11+ (Packaged in Laravel 8+/9+/10+/11+)
* PHP 8.0 / 8.1 / 8.2 / 8.3


## Installation
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
}
],
"require": {
"php": "^8.0|^8.1|^8.2",
"illuminate/collections": "^8.0|^9.0|^10.0",
"illuminate/contracts": "^8.0|^9.0|^10.0"
"php": "^8.0|^8.1|^8.2|^8.3",
"illuminate/collections": "^8.0|^9.0|^10.0|^11.0",
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0",
"nunomaduro/collision": "^7.0|^8.0|^9.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0|^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"orchestra/testbench": "^8.0|^9.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/LaraHierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class LaraHierarchy
/**
* Take a flat collection of objects and transform into a hierarchical collection
*
* @param Collection $collection - Data to be translated to a hierarchy of nodes.
* @param string $parentIdentifier - default: 'parent_id'
* @param string $relationName - default: 'children
* @param Collection $collection - Data to be translated to a hierarchy of nodes.
* @param string $parentIdentifier - default: 'parent_id'
* @param string $relationName - default: 'children
* @param string $localIdentifier - default 'id'
*/
public function collectionToHierarchy(Collection $collection, string $parentIdentifier = 'parent_id', string $relationName = 'children', string $localIdentifier = 'id'): Collection
Expand Down

0 comments on commit 545b84e

Please sign in to comment.