Skip to content

Commit

Permalink
Merge pull request #32 from makeabledk/feat/laravel-10-11
Browse files Browse the repository at this point in the history
Support laravel 10-11
  • Loading branch information
rasmuscnielsen committed Jan 19, 2024
2 parents 7b04e0b + 3d733a3 commit 335038c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1]
laravel: [9.*]
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- php: 8.1
laravel: 11.*

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

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
},
"require": {
"php": ">=7.4.0",
"illuminate/container": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0"
"illuminate/container": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0"
},
"require-dev": {
"fzaninotto/faker": "^1.4",
"laravel/laravel": "^8.0|^9.0",
"fakerphp/faker": "^1.4",
"laravel/laravel": "^10.0|^11.0",
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.5",
"calebporzio/sushi": "^2.0"
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/messages.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

return [
'amount' => 'The :attribute must be a valid money amount.',
'amount' => 'The :attribute field must be a valid money amount.',
];
8 changes: 4 additions & 4 deletions tests/Feature/AmountRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function it_can_validate_amounts_using_string_rule()

$this->handleValidationExceptions();

$error = 'The price must be a valid money amount.';
$error = 'The price field must be a valid money amount.';

$this->postJson('products', ['price' => 123])->assertSuccessful();
$this->postJson('products', ['price' => 123.12])->assertSuccessful();
Expand Down Expand Up @@ -46,9 +46,9 @@ public function min_and_max_values_can_be_specified_using_the_helpers_on_rule_ob
ProductController::$rules = ['price' => ['required', (new \Makeable\LaravelCurrencies\Rules\Amount())->between(0, 1000)]];

[$amountError, $minError, $maxError] = [
'The price must be a valid money amount.',
'The price must be at least 0.',
'The price must not be greater than 1000.',
'The price field must be a valid money amount.',
'The price field must be at least 0.',
'The price field must not be greater than 1000.',
];

$this->handleValidationExceptions();
Expand Down

0 comments on commit 335038c

Please sign in to comment.