Skip to content

Commit 518e974

Browse files
authored
Update README.md
1 parent 34be8ff commit 518e974

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ FEATURE_FOURTH_TEST=false
3030
```
3131

3232
### Direct usage
33+
3334
You can directly access the package's methods as following.
3435

3536
```php
@@ -42,18 +43,35 @@ SimpleFeature::allDisabled(['firstTest', 'thirdTest']) // false
4243
```
4344

4445
### Middleware
46+
4547
The package comes with two middlewares that allow to check whether a given set of features is enabled or disabled.
4648

47-
```
48-
FEATURE_REGISTRATION=true
49-
FEATURE_ON_PREMISE=true
49+
```php
50+
// FEATURE_REGISTRATION=true
51+
// FEATURE_ON_PREMISE=true
5052

5153
Route::get('/register', [RegistrationController::class, 'create'])->middleware('feature.enabled:registration');
5254
Route::get('/billing', [BillingController, 'show'])->middleware('feature.disabled:onPremise');
5355
```
5456

5557
If the feature hasn't the desired state the middleware will abort the request with a 404.
5658

59+
### Blade
60+
61+
Furthermore, you can use conditional Blade directives to render content based on the state of a given feature flag.
62+
63+
```blade
64+
@feature('registration')
65+
<a href="/register">Register</a>
66+
@endfeature
67+
```
68+
69+
```blade
70+
@unlessfeature('onPremise')
71+
...
72+
@endunlessfeature
73+
```
74+
5775
## Testing
5876

5977
```bash
@@ -70,7 +88,7 @@ Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
7088

7189
## Security Vulnerabilities
7290

73-
Please report security vulnerabilities directly to the maintainer. You can find contact information on their GitHub profile.
91+
If you discover any security-related issues, please email security@rescaled.de instead of using the issue tracker.
7492

7593
## Credits
7694

0 commit comments

Comments
 (0)