#How to return validation error if a field was not expected?

9 messages · Page 1 of 1 (latest)

delicate remnant
#

Is there a way to throw a validation error for any extra fields received on a form request?

karmic shard
#

Do you mean if someone adds an input field by editing the source?

rigid edge
#

I don’t think there’s anything out of the box but there’s nothing stopping you making your own validation rule

delicate remnant
delicate remnant
rigid edge
#

Yeah sorry “validation rule” was a bit misleading, I meant there’s nothing stopping you implementing the checks yourself

#

Not sure you’ll gain a whole in lot in honesty though

#

Something like a macro added to Request could work, some sort of middleware, a trait you include in controllers, couple of ways

uneven wren
#

isn't this the exact issue so the fillable property is there for?