Skip to content

Conversation

@rizqyhi
Copy link
Member

@rizqyhi rizqyhi commented Aug 14, 2023

Background

Sometimes the condition inside an if block was wildly duplicated anywhere for some common checks.
Sometimes writing checked, selected, or disabled attributes for an input requires us to write a hard-to-read ternary operator.
Sometimes an element has so many conditional class attribute values that it becomes hard to read.

Solution

This PR backports some blade directives on the newer Laravel version to provide better DX when writing blade templates. The implemented directives are:

  • attribute helper
    • checked
    • selected
    • disabled
    • class
  • auth helper
    • auth
    • guest
  • env helper
    • env
    • production
  • js helper
    • json

@rizqyhi rizqyhi self-assigned this Aug 14, 2023
@rizqyhi rizqyhi changed the title Feature/backport some blade directives Backport some blade directives Aug 15, 2023
@rizqyhi rizqyhi merged commit af060a6 into master Aug 15, 2023
@rizqyhi rizqyhi deleted the feature/backport-some-blade-directives branch August 15, 2023 07:35
@rizqyhi rizqyhi restored the feature/backport-some-blade-directives branch September 22, 2023 08:52
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