Try this:
AppServiceProvider.php
use Illuminate\Support\Facades\Validator;
public function boot()
{
Validator::replacer('required_if', function ($message, $attribute, $rule, $parameters) {
return str_replace([':position', ':value'], $parameters, $message);
});
}
in the validation.php
'custom' => [
'lines.*.text' => [
'required_if' => 'The field text line #:position is required when field type line #:position is :value.',
],
],
'attributes' => [
'lines.*.text' => ':position',
'lines.*.type' => ':position',
],