Closed thehands79 closed 8 months ago
Hi @thehands79! Do you echo the Eloquent model in your Blade as well? Like {!! seo($model !!}
?
Hi, yes that's right here's the code:
@php
$seo = seo()->for($advert);
$pattern = '><!--[if BLOCK]><![endif]-->';
$replacement = '>';
$seo = str_replace($pattern, $replacement, $seo);
$pattern = '&';
$replacement = '&';
$seo = str_replace($pattern, $replacement, $seo);
@endphp
@push('seo')
{!! $seo !!}
@endpush
(I noticed that ampersands in URLs are being encoded too, hence the additional hacky code.)
Hi, thank you! I checked and the tags
and section
properties are only outputted when $SEOData->type === 'article
. The default type is "website", but you can set it to article or other types for specific pages. The tags and section are only relevant for the OpenGraph article output and therefore not included. You can view the source code here.
In order to fix it, you can update the type to article:
return new SEOData(
type: 'article',
// ..
);
HI, thanks for the reply. It would be better if the README was explicit about which properties are available for which types (or did I miss that?). You could add a <table>
with props as rows and types as columns.
Thanks for the idea! The docs already do say it, but it's not super-explicit:
I'm now a bit too busy to create a (Markdown) table, but if you have time, then you can definitely PR it 👍
php 8.2.15 laravel/framework 10.43.0 ralphjsmit/laravel-seo 1.4.3