Skip to content

Commit

Permalink
Merge pull request #3 from yourjhay/develop
Browse files Browse the repository at this point in the history
update master branch from develop
  • Loading branch information
yourjhay committed Oct 9, 2020
2 parents 5cd0e8c + 3dba971 commit b5eae89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Cache/
Logs/
vendor/
Simply/
.idea/
.idea/
node_modules/
16 changes: 12 additions & 4 deletions app/Helper/Validation/Validator.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
<?php

namespace App\Helper\Validation;

Use Simple\Model;

class Validator extends BaseValidator
{
/**
* Use to check wether the given field and value exist in the database
* @param $field
* @param $input
* @param array $param
* @return array|void
*/
public function validate_unique(
$field,
$input,
$param = null
$param = []
) {
self::set_error_messages(array(
"validate_unique" => "{field} is already Taken.",
"unique" => "{field} is already Taken.",
));
$call = Model::unique_checker($param,$field,$input[$field]);
$call = Model::unique_checker($param, $field, $input[$field]);
if(!$call) {
return;
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'rule' => __FUNCTION__,
'param' => $param,
);
}
Expand Down

0 comments on commit b5eae89

Please sign in to comment.