diff --git a/resources/views/fields/matrix.blade.php b/resources/views/fields/matrix.blade.php index 0e4c21eb3..31abcec92 100644 --- a/resources/views/fields/matrix.blade.php +++ b/resources/views/fields/matrix.blade.php @@ -25,7 +25,7 @@ - {{ __('Add row') }} + {{ $addRowLabel ?? __('Add row') }} diff --git a/src/Screen/Fields/Matrix.php b/src/Screen/Fields/Matrix.php index fe92c5672..c9dfe6bde 100644 --- a/src/Screen/Fields/Matrix.php +++ b/src/Screen/Fields/Matrix.php @@ -33,6 +33,7 @@ class Matrix extends Field 'maxRows' => 0, 'keyValue' => false, 'fields' => [], + 'addRowLabel' => null, 'columns' => [ 'key', 'value', @@ -107,6 +108,16 @@ public function fields(array $fields = []): self return $this->set('fields', $fields); } + /** + * @param string $label + * + * @return self + */ + public function addRowLabel(string $label): self + { + return $this->set('addRowLabel', $label); + } + protected function getIdPrefix(): string { $idPrefix = $this->get('idPrefix');