Merge branch 'trunk'
This commit is contained in:
commit
37d1888615
2 changed files with 9 additions and 3 deletions
|
|
@ -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'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue