Added type casting and a few more validation rules

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2020-04-22 06:37:40 -07:00
parent a44d1cc0cf
commit fa5134603f
8 changed files with 52 additions and 9 deletions
+6 -1
View File
@@ -27,9 +27,14 @@ class Location extends SnipeModel
'address2' => 'max:80|nullable',
'zip' => 'min:3|max:10|nullable',
'manager_id' => 'exists:users,id|nullable',
'parent_id' => 'nullable|different:id',
'parent_id' => 'nullable|exists:locations,id|different:id',
);
protected $casts = [
'parent_id' => 'integer',
'manager_id' => 'integer',
];
/**
* Whether the model should inject it's identifier to the unique
* validation rules before attempting validation. If this property