Merge branch 'relations-schemaorg' into 'develop'

fix: 🐛 load only needed relations of models for schema org render

See merge request ldc-web/projets/le-gaulois!223
This commit is contained in:
noah.lancien 2025-06-11 13:09:25 +00:00
commit d3af8a21dc
2 changed files with 2 additions and 2 deletions

View file

@ -271,7 +271,7 @@ class Product extends Model implements SeoInterface, Sitemapable, SchemaOrgInter
*/
public function toSchemaOrg(bool $asReference = false): \Spatie\SchemaOrg\Product
{
$model = $this->load(['recipes', 'claims', 'productTypes', 'claims', 'meat', 'submeat', 'range', 'subrange']);
$model = $this->load(['recipes', 'claims', 'productTypes', 'meat', 'submeat', 'range', 'subrange']);
// Main.
$schema = Schema::Product()

View file

@ -280,7 +280,7 @@ class Recipe extends Model implements SeoInterface, Sitemapable, SchemaOrgInterf
*/
public function toSchemaOrg(bool $asReference = false): \Spatie\SchemaOrg\Recipe
{
$model = $this->load(['consumptionMoment']);
$model = $this->load(['products', 'consumptionMoment', 'video']);
// Main.
$schema = Schema::Recipe()