public function makeOptional($rule)
    {
        $conditions = explode('|', $rule);
        foreach( $conditions as $key => $condition ) {
            if( $condition === 'required' ) {
                unset( $conditions[ $key ] );
            }
        }

        return implode( '|', $conditions );
    }
public function makeOptional($rule)
    {
        $conditions = explode('|', $rule);
        foreach( $conditions as $key => $condition ) {
            if( $condition === 'required' ) {
                unset( $conditions[ $key ] );
            }
        }

        return implode( '|', $conditions );
    }
public function makeOptional ( $ rule ) { $ conditions = explode ( '|' , $ rule ) ; foreach ( $ conditions as $ key => $ condition ) { if ( $ condition === 'required' ) { unset ( $ conditions [ $ key ] ) ; } } return implode ( '|' , $ conditions ) ; }
Force a particular rule to be optional. This method will remove the 'required` option from the rule entirely and
leave all other validation rules intact

@param   string $rule        Rule to be modified
@return string
Force a particular rule to be optional . This method will remove the required option from the rule entirely and leave all other validation rules intact