laravel更新唯一值验证

I have a model with a mobileNumber property. the mobile number is unique and the validation rules are:

public  static  $rulesForEdit = array(
        'firstName' => 'required|min:5',
        'lastName' => 'required|min:5',
        'mobileNumber' => 'required|min:5|unique:admin,mobileNumber|numeric'
    );

when I update the model, I do this:

$data = array('firstName' => Input::get('firstName'),
        'lastName' => Input::get('lastName'),
        'mobileNumber' => Input::get('mobileNumber')
);
$validation = Validator::make($data, Admin::$rulesForEdit);
if($validation->passes()){
    $admin = Admin::find($id);
    $admin->firstName = Input::get('firstName');
    $admin->lastName = Input::get('lastName');
    $admin->mobileNumber = Input::get('mobileNumber');
    $admin->update();
    return Redirect::to("restaurants/admins/".$admin->id);
}else{

    return Redirect::back()->withInput()->withErrors($validation);
}

The problem that I keep getting a validation error message states that : The mobile number has already been taken, which is correct, but the mobile is belongs to the same model that I am updating, there is no other model that took this mobile number, just the one that I want to update. In other words, I am updating the firstname and the last name but not the mobile number,

To force the Validator to ignore unique rule for a given id you may pass the id of that recored which is being validated, for example:

'mobileNumber' => 'required|min:5|numeric|unique:admin,mobileNumber,50'

This, will not check uniqueness of the model if the id is 10, so when you are updating the model you need to pass the id of the current model to ignore the unique rule on this model:

'mobileNumber' => 'required|min:5|numeric|unique:admin,mobileNumber,' . $id


// Replace the Model with the name of your model within the controller 
// update method before the validation takes place 
Model::$rules['mobileNumber'] = 'required|min:5|numeric|unique:admin,mobileNumber,' . $id;