Skip to content

Commit

Permalink
feat(methods): Add custom input field setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ge1i0N committed Nov 6, 2024
1 parent 60d7d85 commit 8744197
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Fields/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 8744197

Please sign in to comment.