Merge branch 'trunk'

This commit is contained in:
System User 2025-07-18 13:04:25 +02:00
commit 37d1888615
2 changed files with 9 additions and 3 deletions

View file

@ -68,7 +68,7 @@ class StoreRecipeRequest extends FormRequest
'steps' => 'required|string|min:15',
'difficulty' => [new Enum(DifficultyEnum::class)],
'duration' => 'required|numeric|between:1,1440',
'tips' => 'nullable|string|min:15',
'tips' => 'required|string|min:15',
'range_id' => 'required|exists:ranges,id',
'status' => 'required|boolean'
];

View file

@ -210,7 +210,7 @@ class Recipe extends Model implements SeoInterface, SchemaOrgInterface
$model->difficulty->label(),
])
->recipeCuisine("Française")
->recipeInstructions($model->tips)
->recipeInstructions(strip_tags($model->tips))
->dateCreated($model->created_at)
->dateModified($model->updated_at)
->datePublished($model->created_at)
@ -226,9 +226,15 @@ class Recipe extends Model implements SeoInterface, SchemaOrgInterface
->headline($model->picture_title)
);
// Steps.
preg_match_all('/<li>(.*?)<\/li>/', $model->steps, $step);
if (count($step[1])) {
$schema->steps($step[1]);
}
// Ingredients.
$ingredientsList = [];
foreach ($this->ingredients as $ingredient) {
foreach ($model->ingredients as $ingredient) {
array_push($ingredientsList, $ingredient['value']);
};
$schema->ingredients($ingredientsList);