From 8744197667e58d3aa4b09b8e96f0aad5c1dd9e32 Mon Sep 17 00:00:00 2001 From: Gennadiy Sevalnev Date: Wed, 6 Nov 2024 15:26:09 +0700 Subject: [PATCH] feat(methods): Add custom input field setter --- src/Fields/Translatable.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Fields/Translatable.php b/src/Fields/Translatable.php index 7fba24a..f80815b 100644 --- a/src/Fields/Translatable.php +++ b/src/Fields/Translatable.php @@ -130,6 +130,17 @@ public function json(): static return $this; } + public function customInputField(string $class): static + { + if (!is_subclass_of($class, Field::class)) { + throw new FieldException('The passed class must be a subclass of MoonShine\Fields\Field'); + } + + $this->inputField = $class; + + return $this; + } + public function keyValue( string $key = 'Language', string $value = 'Value',