Validation Rule Factory
$rules = RuleFactory::make([
'translations.%title%' => 'sometimes|string',
'translations.%content%' => ['required_with:translations.%title%', 'string'],
]);
$validatedData = $request->validate($rules);[
'translations.en.title' => 'sometimes|string',
'translations.de.title' => 'sometimes|string',
'translations.de-DE.title' => 'sometimes|string',
'translations.de-AT.title' => 'sometimes|string',
'translations.en.content' => ['required_with:translations.en.title', 'string'],
'translations.de.content' => ['required_with:translations.de.title', 'string'],
'translations.de-DE.content' => ['required_with:translations.de-DE.title', 'string'],
'translations.de-AT.content' => ['required_with:translations.de-AT.title', 'string'],
]Configuration
RuleFactory::FORMAT_ARRAY
RuleFactory::FORMAT_KEY
Runtime
Last updated
Was this helpful?