42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
class UpdateNutritionPageRequest extends UpdateMiniAcfRequest
|
|
{
|
|
protected $modelVarName = 'nutrition_page';
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
$rules = [
|
|
'menutitle' => 'required|string|min:7|max:50',
|
|
'title' => 'required|string|min:7|max:255',
|
|
'metaTitle' => 'required|string|min:20|max:60',
|
|
'metaDescription' => 'required|string|min:130|max:160',
|
|
'headerContent' => 'required|string|min:10'
|
|
];
|
|
return array_merge(
|
|
$rules,
|
|
$this->generatedRules
|
|
);
|
|
}
|
|
|
|
public function attributes()
|
|
{
|
|
return \array_merge(
|
|
[
|
|
'menutitle' => \trans('Titre menu'),
|
|
'title' => \trans('Titre'),
|
|
'metaTitle' => \trans('Titre'),
|
|
'metaDescription' => \trans('Description meta'),
|
|
'headerContent' => \trans('Contenu entête')
|
|
],
|
|
parent::attributes()
|
|
);
|
|
}
|
|
}
|