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

[6.x] Add includeUnless directive #30538

Merged
merged 1 commit into from
Nov 8, 2019
Merged

[6.x] Add includeUnless directive #30538

merged 1 commit into from
Nov 8, 2019

Conversation

intrepidws
Copy link
Contributor

Much like the role that abort_unless() plays as a more readable opposite to abort_if(), this PR would provide a more readable opposite to @includeWhen. Other existing examples of this paradigm include helper methods throw_if() and throw_unless() and the validation rules required_if and required_unless.

With this PR in place, code like the following:

@includeWhen(! $headless, 'dashboard/partials/nav')

Could be changed to be more readable like this:

@includeUnless($headless, 'dashboard/partials/nav')

@GrahamCampbell GrahamCampbell changed the title Add includeUnless directive [7.x] Add includeUnless directive Nov 7, 2019
@GrahamCampbell GrahamCampbell changed the title [7.x] Add includeUnless directive [6.x] Add includeUnless directive Nov 7, 2019
@taylorotwell taylorotwell merged commit 60a688a into laravel:6.x Nov 8, 2019
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.

None yet

2 participants