Skip to content

Commit

Permalink
Laravel 10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Feb 16, 2023
1 parent 0ed7328 commit 23537e5
Show file tree
Hide file tree
Showing 13 changed files with 364 additions and 376 deletions.
9 changes: 5 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
/phpunit.xml.old export-ignore
/phpcs.xml export-ignore
/docker export-ignore
/.travis.yml export-ignore
/.styleci.yml export-ignore
/.php_cs export-ignore
/.editorconfig export-ignore
/.php-cs-fixer.php export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/coverage export-ignore
/.phpunit.cache export-ignore
48 changes: 8 additions & 40 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,6 @@ jobs:
strategy:
matrix:
include:
# Laravel 6.*
- php: 7.4
laravel: 6.*
testbench: 4.*
composer-flag: '--prefer-stable'
- php: 8.0
laravel: 6.*
testbench: 4.*
composer-flag: '--prefer-stable'
# Laravel 7.*
- php: 7.4
laravel: 7.*
testbench: 5.*
composer-flag: '--prefer-stable'
- php: 8.0
laravel: 7.*
testbench: 5.*
composer-flag: '--prefer-stable'
# Laravel 8.*
- php: 7.4
laravel: 8.*
testbench: 6.*
composer-flag: '--prefer-stable'
- php: 8.0
laravel: 8.*
testbench: 6.*
composer-flag: '--prefer-stable'
- php: 8.1
laravel: 8.*
testbench: 6.*
composer-flag: '--prefer-stable'
# Laravel 9.*
- php: 8.0
laravel: 9.*
testbench: 7.*
composer-flag: '--prefer-stable'
- php: 8.1
laravel: 9.*
testbench: 7.*
composer-flag: '--prefer-stable'
# Laravel 10.*
- php: 8.1
laravel: 10.*
Expand All @@ -56,6 +16,14 @@ jobs:
laravel: 10.*
testbench: 8.*
composer-flag: '--prefer-stable'
- php: 8.1
laravel: 10.*
testbench: 8.*
composer-flag: '--prefer-lowest'
- php: 8.2
laravel: 10.*
testbench: 8.*
composer-flag: '--prefer-lowest'

runs-on: ubuntu-latest

Expand Down
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"illuminate/support": "^6|^7|^8|^9|^10",
"illuminate/database": "^6|^7|^8|^9|^10"
"php": ">=8.1",
"illuminate/support": "^10",
"illuminate/database": "^10"
},
"require-dev": {
"orchestra/testbench": "^3.8|^4.0|^5.0|^6.0|^7.0|^8.0",
"phpunit/phpunit": "^7|^8|^9|^10",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10",
"friendsofphp/php-cs-fixer": "^3.6",
"squizlabs/php_codesniffer": "^3.5"
},
Expand All @@ -33,7 +33,7 @@
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
"test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-html coverage",
"fix": "./vendor/bin/php-cs-fixer fix",
"lint": "./vendor/bin/phpcs --extensions=php"
},
Expand Down
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)
=====================

Copyright © `2021` `korridor`
Copyright © `2023` `korridor`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
31 changes: 17 additions & 14 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false"
colors="true" processIsolation="false" stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
12 changes: 7 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It uses Eloquent models instead of directly querying the database.

**Advantages**
- The rule can be easily extended with the Eloquent builder. (scopes etc.)
- Softdeletes are working out of the box.
- Soft deletes are working out of the box.
- Logic implemented into the models work in the validation as well. (multi tenancy system, etc.)

## Installation
Expand All @@ -23,15 +23,17 @@ You can install the package via composer with following command:
composer require korridor/laravel-model-validation-rules
```

If you want to use this package with older Laravel/PHP version please install the 2.1.* version.

```bash
composer require korridor/laravel-model-validation-rules "^2.1"
```

### Requirements

This package is tested for the following Laravel and PHP versions:

- 10.* (PHP 8.1, 8.2)
- 9.* (PHP 8.0, 8.1)
- 8.* (PHP 7.4, 8.0, 8.1)
- 7.* (PHP 7.4, 8.0)
- 6.* (PHP 7.4, 8.0)

## Usage examples

Expand Down
Loading

0 comments on commit 23537e5

Please sign in to comment.