This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

darrel.anthony35716
darrel.anthony35716

Hi

According to the October CMS documentation (go here: https://octobercms.com/docs/services/validation) you can specify custom validation messages by adding a $messages property to your model, like this:

public $messages = [
  'password.required_without' => 'The password field is required',
];

I found that it only works if the property is called $customMessages though, like this:

public $customMessages = [
  'password.required_without' => 'The password field is required',
];

This took me ages to solve - eventually found the following page which helped: http://octobercms.ru/docs/database-model.md as it has the correct (i.e. $customMessages) name for the property in it.

How do you contact October CMS? I think they should update their docs...

Last updated

JenniferLopez
JenniferLopez

@darrel.anthony35716 The correct formatting for validation for models can be found on this page: https://octobercms.com/docs/database/traits#validation

I will update the other Validation page to make this a little clearer.

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.