Skip to content

Trait Collisions #10

@Israel5

Description

@Israel5

Hi,
I know this issue was addressed in different ways before, but I'm really having troubles and I don't know very much how to solve it.

My stack:

PHP 7.4.7
Laravel 7.20.0
Nova 3.6.0

The problem is when I try to use https://github.com/dcasia/conditional-container and https://github.com/dcasia/nova-json-wrapper at the same time.

For both packages, you have to use the traits to have everything working, but when they are used together, we have conflicts:

class CaseX extends Resource
{

    use HasConditionalContainer, HasJsonWrapper;
    ...

Then you get this error:
image
I know it happens because both traits have repeated methods, but I don't know how to exactly solve this issue.

I've been around checking some possible workarounds, and I found some related links, like:

I read the workarounds, but I didn't understand how to create them.

Could anyone with more experience help me to solve this issue?

Thanks!

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