outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
273 stars 97 forks source link

Fixes duplicate panels. #40

Closed mxm1070 closed 3 years ago

mxm1070 commented 3 years ago

I was testing the new pages feature of the library and I noticed that if you add panels with the same name, but different fields it combines the fields, but also duplicates the panels. This fixes the panel duplication.

NovaSettings::addSettingsFields([
    new Panel('Wrong', [
        Text::make('A', 'a'),
    ])
], [], 'Test');

NovaSettings::addSettingsFields([
    new Panel('Wrong', [
        Text::make('B', 'b'),
    ])
], [], 'Test');

NovaSettings::addSettingsFields([
    new Panel('Correct', [
        Text::make('C', 'c'),
    ])
], [], 'Test');

Before:

Screen Shot 2020-12-01 at 5 02 59 PM

After:

Screen Shot 2020-12-01 at 5 03 45 PM
Tarpsvo commented 3 years ago

Awesome! Thanks for helping out. :) I'll be releasing it in a second.

Tarpsvo commented 3 years ago

Released in version 3.0!