Skip to content

Nova Repeater field doesn't accept Fluent #5883

@JesperFiltenborg

Description

@JesperFiltenborg
  • Laravel Version: 8.47
  • Nova Version: 4.27.12
  • PHP Version: 8.1.13
  • Database Driver & Version: mariadb:10.4
  • Operating System and Version: MAC OS 13.2.1
  • Browser type and version: Microsoft Edge
  • Reproduction Repository: https://github.com/###/###

Description:

I can't use the new Repeater field with the Fluent class, due to it requiring a type of eloquent model.

Error message:
Laravel\Nova\Fields\Repeater\Presets\JSON::get(): Argument #2 ($model) must be of type Illuminate\Database\Eloquent\Model, Laravel\Nova\Support\Fluent given, called in /var/www/html/vendor/laravel/nova/src/Fields/Repeater.php

Detailed steps to reproduce the issue on a fresh Nova installation:

I am using the https://github.com/outl1ne/nova-settings package due to the customer needing to set settings on the fly that can change often on the project globally.
Install the package.
Go to nova service provider
Go to the nova settings function
Add the following:
NovaSettings::addSettingsFields([ Repeater::make('List of test variables') ->repeatables([ Text::make('Test Variable', 'test_var'), ]), ], [], 'Some Setting', 'some_setting');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions