mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-02-24 03:34:12 +01:00
22 lines
454 B
PHP
22 lines
454 B
PHP
<?php
|
|
|
|
use Watson\Validating\ValidatingTrait;
|
|
|
|
class IncidentTemplate extends Eloquent {
|
|
use ValidatingTrait;
|
|
|
|
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);
|
|
});
|
|
}
|
|
}
|