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

Tabs with HasMany conflicts in 1.4.0 #141

Closed
bmoex opened this issue Feb 3, 2021 · 2 comments
Closed

Tabs with HasMany conflicts in 1.4.0 #141

bmoex opened this issue Feb 3, 2021 · 2 comments
Assignees

Comments

@bmoex
Copy link

bmoex commented Feb 3, 2021

Since upgrading from 1.3.1 to 1.4.0 the following error occurs on the overview for a model where this is configured as such;

Error message:
[2021-02-03 12:22:21] local.ERROR: Argument 2 passed to Eminiarts\Tabs\Tab::__construct() must be of the type array, object given, called in /var/www/html/vendor/eminiarts/nova-tabs/src/Tabs.php on line 174 {"userId":"<myid>","exception":"[object] (TypeError(code: 0): Argument 2 passed to Eminiarts\\Tabs\\Tab::__construct() must be of the type array, object given, called in /var/www/html/vendor/eminiarts/nova-tabs/src/Tabs.php on line 174 at /var/www/html/vendor/eminiarts/nova-tabs/src/Tab.php:54)

Actual use:

 Tabs::make('Tab header', [
    HasMany::make('Tab a', 'first-tab', ModelA::class),

    HasMany::make('Tab b', 'second-tab', ModelB::class),
])->showTitle(),
@RVxLab
Copy link
Collaborator

RVxLab commented Feb 3, 2021

Looks like an oversight in type checking as this should be possible. I'll take a look tonight.

As a workaround you can either wrap those in an array or a Tab object like so:

'Tab a' => [ $field ],

// or

Tab::make('Tab a', [ $field ]);

Or until then you can downgrade to the previous version.

Thanks for the report and sorry about the inconvinience.

@RVxLab RVxLab self-assigned this Feb 3, 2021
@RVxLab RVxLab closed this as completed in b806cb4 Feb 3, 2021
@RVxLab
Copy link
Collaborator

RVxLab commented Feb 3, 2021

v1.4.1 has just been released to address this issue. Thanks for your report.

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

2 participants