Fix model validations

This commit is contained in:
James Brooks
2016-10-19 12:29:16 +01:00
parent a7e8ba3697
commit ebf3c8656f
12 changed files with 53 additions and 54 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ class IncidentTemplate extends Model
*/
public $rules = [
'name' => 'required|string',
'slug' => 'string',
'slug' => 'required|string',
'template' => 'required|string',
];
@@ -72,7 +72,7 @@ class IncidentTemplate extends Model
*/
public static function forSlug($slug, $columns = ['*'])
{
$template = static::where('slug', $slug)->firstOrFail($columns);
$template = static::where('slug', '=', $slug)->firstOrFail($columns);
return $template;
}