Skip to content

Instantly share code, notes, and snippets.

@shubhamoy
Last active August 29, 2015 14:11
Show Gist options
  • Save shubhamoy/a49e51340407ac78dd1a to your computer and use it in GitHub Desktop.
Save shubhamoy/a49e51340407ac78dd1a to your computer and use it in GitHub Desktop.
PHP Group: Code Correction
public function check($username)
{
static $rule=null;
if(is_null($rule))
{
$rule = [$username => 'unique:login'];
}
//$validation=Validator::make(array([$username=>$username]),$rule);
$validation=Validator::make(array(['username'=>$username]), $rule);
if($validation->passes())
{
return 'User is registerd';
}
return 'username is available';
}
@basherr
Copy link

basherr commented Dec 15, 2014

Great job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment