-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d81734a
commit 3e15990
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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`: | ||
|
||
|
@@ -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 | ||
|