classes/Models/Admin.php
public function onValidating($validation)
    {
        // Only apply mods when editing an existing record
        if (!$this->exists) {
            return;
        }

        $rules = self::$rules;

        // Make password optional
        $rules = array_except($rules, 'password');

        // Ignore the current record when validating email
        $rules['email'] .= ','.$this->id;

        // Update rules
        $validation->setRules($rules);
    }
public function onValidating($validation)
    {
        // Only apply mods when editing an existing record
        if (!$this->exists) {
            return;
        }

        $rules = self::$rules;

        // Make password optional
        $rules = array_except($rules, 'password');

        // Ignore the current record when validating email
        $rules['email'] .= ','.$this->id;

        // Update rules
        $validation->setRules($rules);
    }
public function onValidating ( $ validation ) { // Only apply mods when editing an existing record if ( ! $ this -> exists ) { return ; } $ rules = self :: $ rules ; // Make password optional $ rules = array_except ( $ rules , 'password' ) ; // Ignore the current record when validating email $ rules [ 'email' ] .= ',' . $ this -> id ; // Update rules $ validation -> setRules ( $ rules ) ; }
Tweak some validation rules

@param Illuminate\Validation\Validator $validation
Tweak some validation rules