diff --git a/src/NovaTabTranslatable.php b/src/NovaTabTranslatable.php index 5312b24..9221fcf 100644 --- a/src/NovaTabTranslatable.php +++ b/src/NovaTabTranslatable.php @@ -4,6 +4,7 @@ use Drobee\NovaSluggable\SluggableText; use Epartment\NovaDependencyContainer\NovaDependencyContainer; +use Illuminate\Contracts\Validation\Rule; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use Laravel\Nova\Fields\Field; @@ -116,12 +117,14 @@ protected function createTranslatedField(Field $originalField, string $locale): return $translatedField; } - public function setRules($translatedField){ + public function setRules($translatedField) { $translatedField->creationRules = $this->setUnique($translatedField->creationRules, $translatedField->meta['locale']); $translatedField->updateRules = $this->setUnique($translatedField->updateRules, $translatedField->meta['locale']); foreach ($translatedField->rules as $key => &$rule) { + if ($rule instanceof Rule) continue; + if (strpos($rule, 'required_lang') !== false){ $langs = explode(',', Str::after($rule,'required_lang:'));