Replies: 8 comments
-
Hi @bedoz, |
Beta Was this translation helpful? Give feedback.
-
Hi @thaqebon, ticket on backpack package is here: Laravel-Backpack/CRUD#5767 Thank you so much. |
Beta Was this translation helpful? Give feedback.
-
Hi @thaqebon |
Beta Was this translation helpful? Give feedback.
-
Guys, @tabacitu replied to me in other issue ticket. And they are working on it. Please also refer to Laravel-Backpack/CRUD#5767 (comment) |
Beta Was this translation helpful? Give feedback.
-
Hey @bedoz and @mrinaldidfs thanks for reporting in. 🙏 I was trying to come with a solution that wasn't a Breaking Change, because the behavior of this package (spatie/laravel-translatable), changed when Previously the casts would only be available for developers when we called This has other issues, for example if you have in your model cast like For me I would consider it a breaking change, but I accept that there are different opinions than mine. I've spent already too much time on this, so I've just merged a "workaround" in our package (Backpack). Please feel free to close this issue 👍 |
Beta Was this translation helpful? Give feedback.
-
@bedoz, forget about casting during initialization; there's nothing wrong with it. It’s essentially the same as manually adding casting attributes to the $casts array in the model class. Could you please describe your issue in detail? Specifically, what actions you're taking, what results you're getting, and what you expect to happen? |
Beta Was this translation helpful? Give feedback.
-
Exactly what I said. Previously there were no casts upon model initialization (unless you manually added them), and now there are. 👍 You can easily test that by doing a You can also test that if you set your cast in the model to We had code in place that specifically checked for the presence of the cast, we didn't used the cast on purpose because our use case is not only a simple translatable column, but it's an aggregate of features that also has the translatable support. I was just explaining @bedoz the root cause for the issue he reported here and in Backpack repository, so please if you don't have anything new to add, refrain from telling the guy that everything is good without the proper knowledge. Cheers |
Beta Was this translation helpful? Give feedback.
-
@pxpm, please note that |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I did a composer update on my project with Backpack for Laravel and this package, the result is that I can no longer save any translations, for some reason the initializeHasTranslations function that casts all the translations to an array at the init of the Model is conflicting with the BackpackForLaravel library. At the moment I have overwritten the function by extending that class and disabling the merge of the casts, but it would be necessary to understand with them what is not working. I will try to report the same ticket on the package hoping to have support in one of the two packages.
For any further information, please feel free to contact me.
Thank you very much
Alex
Beta Was this translation helpful? Give feedback.
All reactions