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