From 78d86319fe1a349cb15bca4a91659893881058a8 Mon Sep 17 00:00:00 2001 From: Travis Britz Date: Wed, 13 Mar 2019 20:14:03 -0500 Subject: [PATCH 1/2] Clarify @json usage in element attributes --- blade.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blade.md b/blade.md index a8c74a7fb30..9ef8341020c 100644 --- a/blade.md +++ b/blade.md @@ -195,6 +195,12 @@ However, instead of manually calling `json_encode`, you may use the `@json` Blad var app = @json($array); +You may also find it useful for seeding Vue components or `data-*` attributes: + + + +> {note} Using `@json` in element attributes requires that it be surrounded by single quotes. + #### HTML Entity Encoding By default, Blade (and the Laravel `e` helper) will double encode HTML entities. If you would like to disable double encoding, call the `Blade::withoutDoubleEncoding` method from the `boot` method of your `AppServiceProvider`: From c33c49f04f9ceb8ccebb70cde04cd32d1d110717 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 16 Mar 2019 09:30:04 -0500 Subject: [PATCH 2/2] Update blade.md --- blade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade.md b/blade.md index 9ef8341020c..811b8641f5f 100644 --- a/blade.md +++ b/blade.md @@ -195,7 +195,7 @@ However, instead of manually calling `json_encode`, you may use the `@json` Blad var app = @json($array); -You may also find it useful for seeding Vue components or `data-*` attributes: +The `@json` directive is also useful for seeding Vue components or `data-*` attributes: