Skip to content

Commit

Permalink
Updates attributes checking section
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudmohamedramadan authored Jul 16, 2022
1 parent d81734a commit 3e15990
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- [Loops](#loops)
- [The Loop Variable](#the-loop-variable)
- [Conditional Classes](#conditional-classes)
- [Checked / Selected / Disabled](#checked-and-selected)
- [Attributes Checking](#attributes-checking)
- [Including Subviews](#including-subviews)
- [The `@once` Directive](#the-once-directive)
- [Raw PHP](#raw-php)
Expand Down Expand Up @@ -437,8 +437,8 @@ The `@class` directive conditionally compiles a CSS class string. The directive
<span class="p-4 text-gray-500 bg-red"></span>
```

<a name="checked-and-selected"></a>
### Checked / Selected / Disabled
<a name="attributes-checking"></a>
### Attributes Checking

For convenience, you may use the `@checked` directive to easily indicate if a given HTML checkbox input is "checked". This directive will echo `checked` if the provided condition evaluates to `true`:

Expand Down Expand Up @@ -467,6 +467,12 @@ Additionally, the `@disabled` directive may be used to indicate if a given eleme
<button type="submit" @disabled($errors->isNotEmpty())>Submit</button>
```

Moreover, the `@readonly` directive may be used to indicate if a given element should be "readonly":

```blade
<input type="email" name="email" value="[email protected]" @readonly($user->isNotAdmin()) />
```

In addition, the `@required` directive may be used to indicate if a given element should be "required":

```blade
Expand Down

0 comments on commit 3e15990

Please sign in to comment.