Skip to content

Commit

Permalink
merge from v6
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Apr 10, 2022
2 parents fbc5050 + 350b3c5 commit f47602e
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Unit Tests

on:
push:
branches:
- master
pull_request:
branches:
- "*"
schedule:
- cron: '0 0 * * *'

jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1

strategy:
fail-fast: false
matrix:
php: [8.1, 8.0, 7.4, 7.3, 7.2]

name: P${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2

- name: Install dependencies
run: |
composer install -o --quiet
- name: Execute Unit Tests
run: composer test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ composer.phar
composer.lock
.DS_Store
.php-cs-fixer.cache
.phpunit.result.cache
.phpunit.result.cache
3 changes: 2 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This is a Laravel 4-8 package for working with trees in relational databases.

It is a fork of [lazychaser/laravel-nestedset](https://github.com/lazychaser/laravel-nestedset) and contains patches which are required for using the library with [Lychee](https://github.com/LycheeOrg/Lychee).

* **Laravel 5.7, 5.8, 6.0, 7.0, 8.0** is supported since v5
* **Laravel 8.0** is supported since v6
* **Laravel 5.7, 5.8, 6.0, 7.0** is supported since v5
* **Laravel 5.5, 5.6** is supported since v4.3
* **Laravel 5.2, 5.3, 5.4** is supported since v4
* **Laravel 5.1** is supported in v3
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
],

"require": {
"php": ">=7.1.3",
"illuminate/support": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
"illuminate/database": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
"illuminate/events": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0"
"php": "^7.2.5|^8.0",
"illuminate/support": "^7.0|^8.0|^9.0",
"illuminate/database": "^7.0|^8.0|^9.0",
"illuminate/events": "^7.0|^8.0|^9.0"
},

"autoload": {
Expand All @@ -26,8 +26,8 @@

"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpunit/phpunit": "^9.3"
},
"phpunit/phpunit": "7.*|8.*|9.*"
},

"scripts": {
"run-tests": [
Expand Down
12 changes: 12 additions & 0 deletions src/BaseRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,16 @@ protected function matchForModel(Model $model, EloquentCollection $results)

return $result;
}

/**
* Get the plain foreign key.
*
* @return mixed
*/
public function getForeignKeyName()
{
// Return a stub value for relation
// resolvers which need this function.
return NestedSet::PARENT_ID;
}
}

0 comments on commit f47602e

Please sign in to comment.