This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
osarzola
Hi, i have this on my RainLab Blog Plugin model, but validation does not works, even the title does not matters if i not fill the input, and also the traits methods afterValidation and PostValidation never called, any clue?
class Post extends Model
{
use \October\Rain\Database\Traits\SoftDeleting;
use \October\Rain\Database\Traits\Validation;
protected $dates = ['deleted_at','published_at'];
public $table = 'rainlab_blog_posts';
/*
* Validation
*/
public $rules = [
'title' => 'required',
'slug' => ['required','regex:/^[a-z0-9\/\:_\-\*\[\]\+\?\|]*$/i','unique:rainlab_blog_posts'],
'content' => 'required',
'excerpt' => ''
];
?>
osarzola
Sorry my mistake.
If you will override the boot method make sure you call the parent implementation :(
public static function boot(){
parent::boot(); //my fool mistake
//Event::listen('post.save', 'backend.updater@onHandler');
}
1-2 of 2