private function saveRelation($action, $key, $value)
    {
        // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful
        if (method_exists($this->model, $key) && is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\Relation')) {
            foreach ($this->{$action.'Relations'} as $relationship => $method) {
                if (is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\\'.$relationship)) {
                    $this->model->$key()->$method($value);

                    return;
                }
            }
        }
    }
private function saveRelation($action, $key, $value)
    {
        // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful
        if (method_exists($this->model, $key) && is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\Relation')) {
            foreach ($this->{$action.'Relations'} as $relationship => $method) {
                if (is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\\'.$relationship)) {
                    $this->model->$key()->$method($value);

                    return;
                }
            }
        }
    }
private function saveRelation ( $ action , $ key , $ value ) { // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful if ( method_exists ( $ this -> model , $ key ) && is_a ( call_user_func_array ( [ $ this -> model , $ key ] , [ ] ) , 'Illuminate\Database\Eloquent\Relations\Relation' ) ) { foreach ( $ this -> { $ action . 'Relations' } as $ relationship => $ method ) { if ( is_a ( call_user_func_array ( [ $ this -> model , $ key ] , [ ] ) , 'Illuminate\Database\Eloquent\Relations\\' . $ relationship ) ) { $ this -> model -> $ key ( ) -> $ method ( $ value ) ; return ; } } } }
Method fired to Save Relations.

@param string $action The current action (either doSave or afterSave)
@param string $key
@param string $value

@return
Method fired to Save Relations .