alvinhu / nova-child-select

Child select field for Laravel Nova
21 stars 12 forks source link

Problem with Tabs #7

Open amidesfahani opened 4 years ago

amidesfahani commented 4 years ago

can not find the field in tabs "eminiarts/nova-tabs"

in options controller $field returns null

$field = $fields->findFieldByAttribute($attribute);

https://github.com/eminiarts/nova-tabs

amidesfahani commented 4 years ago

quick fix in controller

// after $field = $fields->findFieldByAttribute($attribute);
if (!$field)
{
            if ($fields->count() == 1 && isset($fields['Tabs']))
            {
                $tab = $fields->first();
                if (isset($tab['fields']))
                {
                    $fields = $tab['fields'];
                    $field = $fields->findFieldByAttribute($attribute);
                }
            }
}
Yann-BUTSCHER-EIRL commented 4 years ago

@amidesfahani Hello!

Thanks for your fix! It works great. Do you think you can make a pull request? If not, do you think I can make one using this code?

amidesfahani commented 4 years ago

@Yann-BUTSCHER-EIRL amidesfahani/nova-child-select