Closed promatik closed 2 weeks ago
I don't think we will be doing this translated()
and untranslated()
.
The reason why the find methods are translated it's because they are the methods that we (backpack) use. If you use the model outside of admin panel, you should take care to get the translations or not.
Cheers
Today I took a look at
HasTranslations
hand most probably it should have some upgrades.It all started here; https://github.com/Laravel-Backpack/CRUD/issues/5312, @azenot-dev complained about a collision of the create method with another trait, there's nothing we could do regarding that, BUT, to override both
create
andupdate
method isn't the best thing to do.Can we move it to
creating
andupdating
events?Also, I noticed this method;
I found it strange that is is done only for
find*
methods. by doingProduct::first()->name
orProduct::find(1)->name
you may get different results 🤷♂️So Instead of always translating (for finds only), maybe we should add some flag.
or have it translated by default, but have a flag to disable it.