Closed cord closed 2 years ago
Found this on stackoverflow: Collisions with other trait methods
and with some trial & error the following code seems to work
use Rinvex\Attributes\Traits\Attributable as Attributable;
use Rinvex\Support\Traits\HasTranslations as HasTranslations;
class myModel extends Model {
use Attributable, HasTranslations {
HasTranslations::setAttribute insteadof Attributable;
}
}
can you confirm this would be a valid solution?
@cord how did you solve this? I can't make it work.
The solution above works here?
The solution above works here?
It does not work for me I guess. Im getting an error that says “id does not exists” when using both translatable and laravel-attributes.
Sounds like a different issue to me?
I confirm the above solution by @cord, that should work for trait collision.
am trying to use this nice package within nova in combination Spatie\Translatable.
However combining both traits in the model
causes the error
Trait method setAttribute has not been applied, because there are collisions with other trait methods
Is there any way to work around this situation?