Skip to content

Conversation

@alexjustesen
Copy link
Owner

📃 Description

This PR adds custom Blade templates @blank and @filled to improve readability as it was rejected in the core: laravel/framework#51561

🪵 Changelog

➕ Added

  • @blank and @filled Blade templates to improve readability.

🤔 Usage

Using @blank() in a view:

// before
@if (blank())
    i am blank
@endif

// after
@blank($var)
    i am blank
@endblank

Using @filled() in a view:

// before
@if (! blank($var))
    i am not blank (filled)
@endif

// or

@if (filled($var))
    i am not blank (filled)
@endif

// after
@filled($var)
    i am not blank (filled)
@endfilled

@alexjustesen alexjustesen added the feature New feature or request label Dec 24, 2024
@alexjustesen alexjustesen self-assigned this Dec 24, 2024
@alexjustesen alexjustesen merged commit 7dc54e1 into main Dec 24, 2024
1 check passed
@alexjustesen alexjustesen deleted the define-blank-and-filled-blade-if-statements branch December 24, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants