Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom resource tool does not display other tabs #264

Open
jaspercjc opened this issue Nov 6, 2022 · 0 comments
Open

Custom resource tool does not display other tabs #264

jaspercjc opened this issue Nov 6, 2022 · 0 comments

Comments

@jaspercjc
Copy link

jaspercjc commented Nov 6, 2022

I have encountered a problem when displaying a resource tool in tabs.
If I place the resource tool on the first tab, It does not show the other tabs but it works fine if it is not in the first tab.

Code in the resource:

public function fields(NovaRequest $request)
    {
        return [
            Text::make('Name')->sortable()->onlyOnIndex(),

            Tabs::make(__('Catalogue: '.$this->name), [
                Tab::make('Settings', [
                    CatalogueSettings::make()->settings($this->settings), //custom resource tool
                ]),
                Tab::make('Products', [
                    HasMany::make('Products', 'catalogueProducts', 'App\Nova\CatalogueProduct'),
                ]),
                Tab::make('Collections', [
                    HasMany::make('Collections', 'catalogueCollections', 'App\Nova\CatalogueCollection'),
                ]),
            ])->withToolbar(),        
        ];
    }

Result:
image

But if I put it on the second tab for example:

Tabs::make(__('Catalogue: '.$this->name), [
                Tab::make('Products', [
                    HasMany::make('Products', 'catalogueProducts', 'App\Nova\CatalogueProduct'),
                ]),
                Tab::make('Settings', [
                    CatalogueSettings::make()->settings($this->settings), //custom resource tool
                ]),
                Tab::make('Collections', [
                    HasMany::make('Collections', 'catalogueCollections', 'App\Nova\CatalogueCollection'),
                ]),
            ])->withToolbar(), 

Result:
image

I have tried creating it using Panel but I got the same result

new Panel('Settings', [
     CatalogueSettings::make()->settings($this->settings),
])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant