Skip to content

[7.x] sectionMissing Blade Directive#33614

Merged
taylorotwell merged 1 commit into
laravel:7.xfrom
ahinkle:sectionMissing
Jul 21, 2020
Merged

[7.x] sectionMissing Blade Directive#33614
taylorotwell merged 1 commit into
laravel:7.xfrom
ahinkle:sectionMissing

Conversation

@ahinkle

@ahinkle ahinkle commented Jul 21, 2020

Copy link
Copy Markdown
Contributor

This PR adds an easy to use sectionMissing() blade directive. This is useful in situations where you only need the inverse of hasSection().

Purposed:

@sectionMissing('hero_image')
    @include('layout.alt_navigation')
@endif

Current:

@if (! trim($__env->yieldContent('hero_image')))
    @include('layout.alt_navigation')
@endif

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.

2 participants