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

[1.x] Add a new @featureany directive #122

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

ryangjchandler
Copy link
Contributor

@ryangjchandler ryangjchandler commented Sep 30, 2024

Similar to the @canany directive that Laravel provides, this new directive allows you to check the status of multiple features at once with boolean OR behaviour with the @featureany directive.

@featureany(['foo', 'bar'])
    foo or bar is active
@else
    foo and bar are inactive
@endfeatureany

I went for the featureany since it is more inline with other directives that do a similar thing, but I also had the idea of adding array support to the regular @feature directive.

There's no value comparison support because it didn't make sense since different features will likely have different values.

Open to feedback of course!

@taylorotwell taylorotwell merged commit 7d66966 into laravel:1.x Sep 30, 2024
8 checks passed
@ryangjchandler ryangjchandler deleted the multiple-feature-checks branch September 30, 2024 14:51
@timacdonald
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants