Skip to content

Commit

Permalink
Tighter data validation on name
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 26, 2013
1 parent 680b377 commit 3f4ce40
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Asset extends Elegant {
protected $table = 'assets';
protected $softDelete = true;
protected $rules = array(
'name' => 'required|min:3',
'name' => 'required|alpha_dash|min:3',
'asset_tag' => 'required|min:3|unique:assets',
'model_id' => 'required',
'serial' => 'required|min:3',
Expand Down
2 changes: 1 addition & 1 deletion app/models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Category extends Elegant {
* Category validation rules
*/
protected $rules = array(
'name' => 'required|min:2',
'name' => 'required|alpha_dash|min:2',
);


Expand Down
2 changes: 1 addition & 1 deletion app/models/Depreciation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Depreciation extends Elegant {

// Declare the rules for the form validation
protected $rules = array(
'name' => 'required|min:3',
'name' => 'required|alpha_dash|min:3',
'months' => 'required|min:1|integer',
);

Expand Down
2 changes: 1 addition & 1 deletion app/models/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class License extends Elegant {
protected $table = 'licenses';
protected $softDelete = true;
protected $rules = array(
'name' => 'required|min:3',
'name' => 'required|alpha_dash|min:3',
'serial' => 'required|min:5',
'seats' => 'required|min:1|integer',
'license_email' => 'email',
Expand Down
4 changes: 2 additions & 2 deletions app/models/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class Location extends Elegant {
protected $softDelete = true;
protected $table = 'locations';
protected $rules = array(
'name' => 'required|min:3',
'city' => 'required|min:3',
'name' => 'required|alpha_dash|min:3',
'city' => 'required|alpha_dash|min:3',
'state' => 'required|alpha|min:2|max:2',
'country' => 'required|alpha|min:2|max:2',
);
Expand Down
2 changes: 1 addition & 1 deletion app/models/Manufacturer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Manufacturer extends Elegant {
protected $softDelete = true;
// Declare the rules for the form validation
protected $rules = array(
'name' => 'required|min:2',
'name' => 'required|alpha_dash|min:2',
);

public function has_models()
Expand Down
4 changes: 2 additions & 2 deletions app/models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Model extends Elegant {

// Declare the rules for the form validation
protected $rules = array(
'name' => 'required|min:3',
'category_id' => 'required',
'name' => 'required|alpha_dash|min:3',
'category_id' => 'required|integer',
);

public function assets()
Expand Down
2 changes: 1 addition & 1 deletion app/models/Statuslabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Statuslabel extends Elegant {
protected $softDelete = true;

protected $rules = array(
'name' => 'required|min:2',
'name' => 'required|alpha_dash|min:2',
);

public function has_assets()
Expand Down

0 comments on commit 3f4ce40

Please sign in to comment.