View more context

 

nightjarnz

Which would rely the message back to the user nicely

Admonish

Perhaps then it would make sense to use a method instead

Admonish

And in that method I would always get the first record (with ->first())

Admonish

As for the interface, I would have to update the modelAdmin functionality to make it remove the Gridfield for any dataobject with the word "Settings" in it

Admonish

But your right, for a robust solution I would have to add a onBeforeWrite() check

Admonish

because even if you don't give the user a way to create multiple instances/records of the setting DataObject developers (read my future self) would be able to programically

Admonish

😞 My future self may be my worst enemy when it comes to web development 😞

MichalKleiner

or when it comes to any other thing for the matter 😄