original_string: protected function setForeignKeysToNull(Model $model, Relation $relation, array $keys)
      {
          if ( ! count($keys)) return;
  
          $key           = $this->normalizeForeignKey(head($keys));
          $model->{$key} = null;
  
          if (    count($keys) > 1
              &&  (   $relation instanceof MorphTo
                  ||  $relation instanceof MorphOne
                  ||  $relation instanceof MorphMany
              )
          ) {
              $key           = $this->normalizeForeignKey(array_values($keys)[1]);
              $model->{$key} = null;
          }
  
          $model->save();
      }
code: protected function setForeignKeysToNull(Model $model, Relation $relation, array $keys)
      {
          if ( ! count($keys)) return;
  
          $key           = $this->normalizeForeignKey(head($keys));
          $model->{$key} = null;
  
          if (    count($keys) > 1
              &&  (   $relation instanceof MorphTo
                  ||  $relation instanceof MorphOne
                  ||  $relation instanceof MorphMany
              )
          ) {
              $key           = $this->normalizeForeignKey(array_values($keys)[1]);
              $model->{$key} = null;
          }
  
          $model->save();
      }
code_tokens: protected function setForeignKeysToNull ( Model $ model , Relation $ relation , array $ keys ) { if ( ! count ( $ keys ) ) return ; $ key = $ this -> normalizeForeignKey ( head ( $ keys ) ) ; $ model -> { $ key } = null ; if ( count ( $ keys ) > 1 && ( $ relation instanceof MorphTo || $ relation instanceof MorphOne || $ relation instanceof MorphMany ) ) { $ key = $ this -> normalizeForeignKey ( array_values ( $ keys ) [ 1 ] ) ; $ model -> { $ key } = null ; } $ model -> save ( ) ; }
docstring: Sets the foreign keys to null on a given model.
  
  @param Model    $model
  @param Relation $relation
  @param string[] $keys
docstring_tokens: Sets the foreign keys to null on a given model .