Cachet/app/models/IncidentTemplate.php

21 lines
453 B
PHP
Raw Normal View History

<?php
use Watson\Validating\ValidatingTrait;
2014-11-27 14:11:09 +00:00
class IncidentTemplate extends Eloquent {
use ValidatingTrait;
2014-11-27 14:11:09 +00:00
protected $rules = [
'name' => 'alpha|required',
'slug' => 'alpha_dash|required',
'template' => 'required'
];
public static function boot() {
parent::boot();
self::on('saving', function($template) {
$template->slug = Str::slug($template->name);
});
}
}