Commit a22a79d
committed
Convert breadcrumb list items to a plain array before encoding
spatie/schema-org's serializeProperty() only recurses into PHP arrays,
so the Laravel Collection passed to itemListElement() got coerced via
__toString() into a JSON string. That left BreadcrumbList with a
stringified itemListElement and per-item @context, which Search Console
flagged as invalid (#215). Calling ->all() lets serializeProperty
recurse normally and strip the nested @context.1 parent 8ba6d12 commit a22a79d
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
336 | 343 | | |
337 | 344 | | |
338 | 345 | | |
| |||
0 commit comments