Detailed steps to reproduce the issue on a fresh Nova installation:
Register a repeater field with hasMany preset in a Resource as below
Add few records
Delete the second last record
//Resource Class
use App\Nova\Repeater\Email;
public function fields(NovaRequest $request)
{
return [
Repeater::make('Emails', 'emails')
->asHasMany()
->uniqueField('id')
->repeatables([
Email::make()
])
];
}
//Repeater Class
class Email extends Repeatable
{
/**
* The underlying model the repeatable represents.
*
* @var class-string
*/
public static $model = ResourceModel::class;
/**
* Get the fields displayed by the repeatable.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::hidden('id'),
Text::make('Email', 'value'),
Boolean::make('Verified'),
Boolean::make('Is Primary')
];
}
}
Description:
When i try to delete the repeater field items it deletes the items on that index, which is expected, along with other items after that index.
https://github.com/laravel/nova-issues/assets/32788937/b672af75-4922-43a0-84a0-7496340c9b97
Detailed steps to reproduce the issue on a fresh Nova installation: