Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 support #54

Merged
merged 27 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ jobs:
- 'prefer-stable'

exclude:
- laravel: '11.*'
php: '8.2'
- laravel: '11.*'
php: '8.1'
- laravel: '11.*'
php: '8.0'
- laravel: '10.*'
php: '8.0'


include:
- laravel: '11.*'
php: '8.3'
testbench: '9.*'
- laravel: '10.*'
php: '8.3'
testbench: '8.*'
Expand Down Expand Up @@ -69,7 +80,7 @@ jobs:

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -79,9 +90,17 @@ jobs:
coverage: none

- name: Install dependencies
if: matrix.laravel != '11.*' || matrix.php != '8.3'
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Install dependencies
if: matrix.laravel == '11.*' && matrix.php == '8.3'
run: |
composer require "laravel/framework:11.*" "orchestra/testbench:9.*" --no-interaction --no-update --dev
composer update --prefer-stable --prefer-dist --no-interaction


- name: Execute tests
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ vendor
coverage
.idea
.phpunit.result.cache
.phpunit.cache
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ php artisan migrate
You can publish the config-file with:

```bash
php artisan vendor:publish --provider=BeyondCode\Vouchers\VouchersServiceProvider --tag="config"
php artisan vendor:publish --provider="BeyondCode\Vouchers\VouchersServiceProvider" --tag="config"
```

This is the contents of the published config file:
This is the content of the published config file:

```php
<?php
Expand Down Expand Up @@ -98,6 +98,14 @@ return [
];
```

If necessary, you can publish the translation files for further customization:

```bash
php artisan vendor:publish --provider="BeyondCode\Vouchers\VouchersServiceProvider" --tag="translations"
```

You can access the translations of the package like so: `__('vouchers::validation.code_invalid')`.

## Usage

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.
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
],
"require": {
"php": "^7.1|^8.0",
"illuminate/config": "^8.0|^9.0|^10.0",
"illuminate/database": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0"
"illuminate/config": "^8.0|^9.0|^10.0|^11.0",
"illuminate/database": "^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^8.0|^9.0",
"orchestra/testbench": "^6.0|^8.0"
"phpunit/phpunit": "^8.0|^9.0|^10.0",
"orchestra/testbench": "^6.0|^8.0|^9.0"
},
"autoload": {
"psr-4": {
Expand Down
23 changes: 23 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="false"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>
</phpunit>