Incident API can now use incident templates with Twig templating
This commit is contained in:
@@ -58,4 +58,17 @@ class IncidentTemplate extends Model
|
||||
$template->slug = Str::slug($template->name);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a template by the slug.
|
||||
*
|
||||
* @param \Illuminate\Database\Query\Builder $query
|
||||
* @param string $slug
|
||||
*
|
||||
* @return \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
public function scopeForSlug($query, $slug)
|
||||
{
|
||||
return $query->where('slug', $slug);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user