This Laravel Nova package allows you to create simple horizontal rows of fields that the user can add/remove.
php: >=7.2
laravel/nova: ^3.0
A Laravel Nova simple repeatable rows field.
Install the package in to a Laravel app that uses Nova via composer:
composer require optimistdigital/nova-simple-repeatable
use OptimistDigital\NovaSimpleRepeatable\SimpleRepeatable;
public function fields(Request $request) {
SimpleRepeatable::make('Users', 'users', [
Text::make('First name'),
Text::make('Last name'),
Email::make('Email'),
])
->canAddRows(true) // Optional, true by default
->canDeleteRows(true), // Optional, true by default
}
The translations file can be published by using the following publish command:
php artisan vendor:publish --provider="OptimistDigital\NovaSimpleRepeatable\SimpleRepeatableServiceProvider" --tag="translations"
You can then edit the strings to your liking.
Nova Simple Repeatable is open-sourced software licensed under the MIT license.