Skip to content

Commit 82e6368

Browse files
authored
Merge pull request #54 from beyondcode/laravel-11
Laravel 11 support
2 parents 3ed053e + babb18d commit 82e6368

File tree

5 files changed

+60
-9
lines changed

5 files changed

+60
-9
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,20 @@ jobs:
2727
- 'prefer-stable'
2828

2929
exclude:
30+
- laravel: '11.*'
31+
php: '8.2'
32+
- laravel: '11.*'
33+
php: '8.1'
34+
- laravel: '11.*'
35+
php: '8.0'
3036
- laravel: '10.*'
3137
php: '8.0'
38+
39+
3240
include:
41+
- laravel: '11.*'
42+
php: '8.3'
43+
testbench: '9.*'
3344
- laravel: '10.*'
3445
php: '8.3'
3546
testbench: '8.*'
@@ -69,7 +80,7 @@ jobs:
6980

7081
steps:
7182
- name: Checkout code
72-
uses: actions/checkout@v2
83+
uses: actions/checkout@v4
7384

7485
- name: Setup PHP
7586
uses: shivammathur/setup-php@v2
@@ -79,9 +90,17 @@ jobs:
7990
coverage: none
8091

8192
- name: Install dependencies
93+
if: matrix.laravel != '11.*' || matrix.php != '8.3'
8294
run: |
8395
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
84-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
96+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
97+
98+
- name: Install dependencies
99+
if: matrix.laravel == '11.*' && matrix.php == '8.3'
100+
run: |
101+
composer require "laravel/framework:11.*" "orchestra/testbench:9.*" --no-interaction --no-update --dev
102+
composer update --prefer-stable --prefer-dist --no-interaction
103+
85104
86105
- name: Execute tests
87106
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ vendor
55
coverage
66
.idea
77
.phpunit.result.cache
8+
.phpunit.cache

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ php artisan migrate
3939
You can publish the config-file with:
4040

4141
```bash
42-
php artisan vendor:publish --provider=BeyondCode\Vouchers\VouchersServiceProvider --tag="config"
42+
php artisan vendor:publish --provider="BeyondCode\Vouchers\VouchersServiceProvider" --tag="config"
4343
```
4444

45-
This is the contents of the published config file:
45+
This is the content of the published config file:
4646

4747
```php
4848
<?php
@@ -98,6 +98,14 @@ return [
9898
];
9999
```
100100

101+
If necessary, you can publish the translation files for further customization:
102+
103+
```bash
104+
php artisan vendor:publish --provider="BeyondCode\Vouchers\VouchersServiceProvider" --tag="translations"
105+
```
106+
107+
You can access the translations of the package like so: `__('vouchers::validation.code_invalid')`.
108+
101109
## Usage
102110

103111
The basic concept of this package is that you can create vouchers, that are associated with a specific model. For example, you could have an application that sells online video courses and a voucher would give a user access to one specific video course.

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
],
1818
"require": {
1919
"php": "^7.1|^8.0",
20-
"illuminate/config": "^8.0|^9.0|^10.0",
21-
"illuminate/database": "^8.0|^9.0|^10.0",
22-
"illuminate/support": "^8.0|^9.0|^10.0"
20+
"illuminate/config": "^8.0|^9.0|^10.0|^11.0",
21+
"illuminate/database": "^8.0|^9.0|^10.0|^11.0",
22+
"illuminate/support": "^8.0|^9.0|^10.0|^11.0"
2323
},
2424
"require-dev": {
2525
"mockery/mockery": "^1.4",
26-
"phpunit/phpunit": "^8.0|^9.0",
27-
"orchestra/testbench": "^6.0|^8.0"
26+
"phpunit/phpunit": "^8.0|^9.0|^10.0",
27+
"orchestra/testbench": "^6.0|^8.0|^9.0"
2828
},
2929
"autoload": {
3030
"psr-4": {

phpunit.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
requireCoverageMetadata="false"
8+
beStrictAboutCoverageMetadata="false"
9+
beStrictAboutOutputDuringTests="false"
10+
failOnRisky="true"
11+
failOnWarning="true">
12+
<testsuites>
13+
<testsuite name="default">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
18+
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
19+
<include>
20+
<directory>src</directory>
21+
</include>
22+
</source>
23+
</phpunit>

0 commit comments

Comments
 (0)