Skip to content

feat: adding Laravel 11 support + pest [v4.1.0] #12

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

Merged
merged 8 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
57 changes: 28 additions & 29 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,39 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
matrix:
php: [8.1]
laravel: [10.*]
exclude:
- php: 8.1
laravel: 10.*
php: [8.2, 8.3, 8.4]
laravel: [10.*, 11.*]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

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

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/pest
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ You can install the package via composer:
composer require pod-point/laravel-configcat
```

For Laravel 5.4 up to 9.x

```bash
composer require pod-point/laravel-mail-export:^3.0
```

### Publishing the config file

Next, you should publish the Laravel package configuration file using the `vendor:publish` Artisan command. It will be placed in your application's config directory:
Expand Down Expand Up @@ -71,12 +77,12 @@ Validator::make([
]);
```

- When the feature flag is **on**
- The `email` will be a required field
- The `username` will be an optional field
- When the feature flag is **off**, undefined, a text or number setting
- The `email` will be an optional field
- The `username` will be a required field
- When the feature flag is **on**
- The `email` will be a required field
- The `username` will be an optional field
- When the feature flag is **off**, undefined, a text or number setting
- The `email` will be an optional field
- The `username` will be a required field

### HTTP middleware

Expand Down Expand Up @@ -244,10 +250,10 @@ Please see [CONTRIBUTING](https://github.com/Pod-Point/laravel-configcat/blob/ma

## Credits

- [configcat/php-sdk](https://github.com/configcat/php-sdk)
- [ylsideas/feature-flags](https://github.com/ylsideas/feature-flags) for inspiration
- [Pod Point](https://github.com/pod-point)
- [All Contributors](https://github.com/pod-point/laravel-configcat/graphs/contributors)
- [configcat/php-sdk](https://github.com/configcat/php-sdk)
- [ylsideas/feature-flags](https://github.com/ylsideas/feature-flags) for inspiration
- [Pod Point](https://github.com/pod-point)
- [All Contributors](https://github.com/pod-point/laravel-configcat/graphs/contributors)

## License

Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
}
],
"require": {
"php": ">=8.1",
"php": "^8.2",
"configcat/configcat-client": "^9.0",
"illuminate/contracts": "^10.0"
"illuminate/contracts": "^10.0|^11.0"
},
"require-dev": {
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^9.6",
"orchestra/testbench": "^8.0|^9.0",
"pestphp/pest": "^2.28",
"mockery/mockery": "^1.6.7"
},
"autoload": {
Expand All @@ -50,15 +50,15 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit --colors=always",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
"test": "vendor/bin/pest"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"kylekatarnls/update-helper": true
"kylekatarnls/update-helper": true,
"pestphp/pest-plugin": true
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/ConfigCat.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function fake(array $flagsToFake = []): ConfigCatFake
return $fake;
}

protected static function isFake(): bool
public static function isFake(): bool
{
$name = static::getFacadeAccessor();

Expand Down
Loading