mirror of
https://github.com/flarum/framework.git
synced 2025-06-10 10:53:33 +08:00
Add model validation messages
This commit is contained in:
@ -134,7 +134,14 @@ class Model extends Eloquent
|
|||||||
|
|
||||||
$rules = $this->expandUniqueRules(array_only(static::$rules, array_keys($dirty)));
|
$rules = $this->expandUniqueRules(array_only(static::$rules, array_keys($dirty)));
|
||||||
|
|
||||||
return static::$validator->make($dirty, $rules);
|
// TODO: translation
|
||||||
|
$messages = [
|
||||||
|
'unique' => 'That :attribute has already been taken.',
|
||||||
|
'email' => 'The :attribute must be a valid email address.',
|
||||||
|
'alpha_num' => 'The :attribute may only contain letters and numbers.'
|
||||||
|
];
|
||||||
|
|
||||||
|
return static::$validator->make($dirty, $rules, $messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user