#Hydrating Models, bad?

17 messages · Page 1 of 1 (latest)

versed solar
#

I'm building a SaaS app that we hope will have very large uptake, and therefore I'm interested in building it efficiently.

I read on https://github.com/michael-rubel/livewire-best-practices that you should not have models as public properties due to the constant de/hydration. However, as I've not really use Livewire at scale before I'm not sure how "true" the above is.

So, is having a (non-user) model as a public property the wrong approach?

daring lichen
#

Yeah I’d avoid using model binding if you can

versed solar
#

ya did some more reading, that's what I figured out

#

looking forward to v3 and seeing what you folks have come up with!

#

bah how do I mark this as 'sovled'

daring lichen
#

These days I'm tending to just use wireable DTOs and bind to them instead of models

versed solar
#

yup, exactly what I converted to

daring lichen
#

Just select tag > and then solved

versed solar
#

using Spatie data package

daring lichen
#

Sweet! 😁 that is the way (minus the Spatie package 😆)

versed solar
#

their package is so good

#

lol can't find the tags

#

sometimes discors is stupid

daring lichen
daring lichen
versed solar
#

got it, thanks!

#

their dto handles the db casting too, plus validation...it's got everything