-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Trait Method Collision Error #19
Comments
I've just come across almost this exact issue, while trying to add this package to an app that uses Translatable. The issue is that both traits are attempting to overwrite the base
I wonder if, long term, the idea of overwriting the handleRecordCreation method to modify how records are saved with traits isn't the best approach for either package. |
A possible fix would be to provide our own Translatable implementation just like we do in Nested Resources, but then if these two packages would be used together, a collision will still happen. For now, do as @dave-mills suggests. You can also "override" the name of a trait method: use Translatable {
Translatable::handleRecordCreation as filamentHandleRecordCreation;
}
and then you can call the `filamentHandleRecordCreation` method in your code if and when needed. |
Thanks @lukas-frey for the idea of overriding the trait names. That's instantly tidied up my mess of a function! |
Description:
After adding the traits to all the resource pages I am getting the following error.
Note: It's happening because of Filament Translatable plugin.
Environment:
Possible Solution:
To resolve the collision, consider renaming one of the conflicting methods..
The text was updated successfully, but these errors were encountered: