protected function defaults($options, $relatedModel)
    {
        $defaults = [
            'model' => $relatedModel,
            'columnToSum' => 'total',
            'field' => $this->field($this->model, 'total'),
            'foreignKey' => $this->field($relatedModel, 'id'),
            'key' => 'id'
        ];

        return array_merge($defaults, $options);
    }
protected function defaults($options, $relatedModel)
    {
        $defaults = [
            'model' => $relatedModel,
            'columnToSum' => 'total',
            'field' => $this->field($this->model, 'total'),
            'foreignKey' => $this->field($relatedModel, 'id'),
            'key' => 'id'
        ];

        return array_merge($defaults, $options);
    }
protected function defaults ( $ options , $ relatedModel ) { $ defaults = [ 'model' => $ relatedModel , 'columnToSum' => 'total' , 'field' => $ this -> field ( $ this -> model , 'total' ) , 'foreignKey' => $ this -> field ( $ relatedModel , 'id' ) , 'key' => 'id' ] ; return array_merge ( $ defaults , $ options ) ; }
Returns necessary defaults, overwritten by provided options.

@param array $options
@param string $relatedModel
@return array
Returns necessary defaults overwritten by provided options .