Skip to content

Commit 16ff347

Browse files
Document 'only' and 'except' for blade attributes (#10248)
* Document 'only' and 'except' for blade attributes * Update blade.md --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent d914fa3 commit 16ff347

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

blade.md

+12
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,18 @@ You may retrieve a specific attribute's value using the `get` method:
11561156
{{ $attributes->get('class') }}
11571157
```
11581158

1159+
The `only` method may be used to retrieve only the attributes with the given keys:
1160+
1161+
```blade
1162+
{{ $attributes->only(['class']) }}
1163+
```
1164+
1165+
The `except` method may be used to retrieve all attributes except those with the given keys:
1166+
1167+
```blade
1168+
{{ $attributes->except(['class']) }}
1169+
```
1170+
11591171
<a name="reserved-keywords"></a>
11601172
### Reserved Keywords
11611173

0 commit comments

Comments
 (0)