Form Validation or Model Validation?

Posted 4 years ago by dancourse

So I've got a model with rules written into it. Should I be using those to validate form entry or creating a whole other Form Validation class to carry out the validation per. form?

Thanks!

DanC

public static $rules = [
        'name'      => array('required', 'min:5', 'max:30'),
        'email'     => array('required', 'min:5', 'max:90', 'email', 'unique:users'),
        'password'  => array('required', 'min:5', 'max:30'),
        'regions'   => 'max:4'
    ];

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.