Skip to content

Commit 687b781

Browse files
authored
consistent styling for multi-line attributes (#9941)
we had a mix of multiline attribute styling, some with the first attribute on the first line and some on the second line. this converts them all to be the same.
1 parent e3cf074 commit 687b781

File tree

2 files changed

+34
-20
lines changed

2 files changed

+34
-20
lines changed

blade.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,12 @@ Likewise, the `@style` directive may be used to conditionally add inline CSS sty
482482
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`:
483483

484484
```blade
485-
<input type="checkbox"
486-
name="active"
487-
value="active"
488-
@checked(old('active', $user->active)) />
485+
<input
486+
type="checkbox"
487+
name="active"
488+
value="active"
489+
@checked(old('active', $user->active))
490+
/>
489491
```
490492

491493
Likewise, the `@selected` directive may be used to indicate if a given select option should be "selected":
@@ -509,19 +511,23 @@ Additionally, the `@disabled` directive may be used to indicate if a given eleme
509511
Moreover, the `@readonly` directive may be used to indicate if a given element should be "readonly":
510512

511513
```blade
512-
<input type="email"
513-
name="email"
514-
value="email@laravel.com"
515-
@readonly($user->isNotAdmin()) />
514+
<input
515+
type="email"
516+
name="email"
517+
value="email@laravel.com"
518+
@readonly($user->isNotAdmin())
519+
/>
516520
```
517521

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

520524
```blade
521-
<input type="text"
522-
name="title"
523-
value="title"
524-
@required($user->isAdmin()) />
525+
<input
526+
type="text"
527+
name="title"
528+
value="title"
529+
@required($user->isAdmin())
530+
/>
525531
```
526532

527533
<a name="including-subviews"></a>
@@ -1641,9 +1647,11 @@ The `@error` directive may be used to quickly check if [validation error message
16411647
16421648
<label for="title">Post Title</label>
16431649
1644-
<input id="title"
1650+
<input
1651+
id="title"
16451652
type="text"
1646-
class="@error('title') is-invalid @enderror">
1653+
class="@error('title') is-invalid @enderror"
1654+
/>
16471655
16481656
@error('title')
16491657
<div class="alert alert-danger">{{ $message }}</div>
@@ -1657,9 +1665,11 @@ Since the `@error` directive compiles to an "if" statement, you may use the `@el
16571665
16581666
<label for="email">Email address</label>
16591667
1660-
<input id="email"
1668+
<input
1669+
id="email"
16611670
type="email"
1662-
class="@error('email') is-invalid @else is-valid @enderror">
1671+
class="@error('email') is-invalid @else is-valid @enderror"
1672+
/>
16631673
```
16641674

16651675
You may pass [the name of a specific error bag](/docs/{{version}}/validation#named-error-bags) as the second parameter to the `@error` directive to retrieve validation error messages on pages containing multiple forms:
@@ -1669,9 +1679,11 @@ You may pass [the name of a specific error bag](/docs/{{version}}/validation#nam
16691679
16701680
<label for="email">Email address</label>
16711681
1672-
<input id="email"
1682+
<input
1683+
id="email"
16731684
type="email"
1674-
class="@error('email', 'login') is-invalid @enderror">
1685+
class="@error('email', 'login') is-invalid @enderror"
1686+
/>
16751687
16761688
@error('email', 'login')
16771689
<div class="alert alert-danger">{{ $message }}</div>

validation.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,12 @@ You may use the `@error` [Blade](/docs/{{version}}/blade) directive to quickly d
220220
221221
<label for="title">Post Title</label>
222222
223-
<input id="title"
223+
<input
224+
id="title"
224225
type="text"
225226
name="title"
226-
class="@error('title') is-invalid @enderror">
227+
class="@error('title') is-invalid @enderror"
228+
/>
227229
228230
@error('title')
229231
<div class="alert alert-danger">{{ $message }}</div>

0 commit comments

Comments
 (0)