original_string: protected function translateOrNew(string $locale): Model
      {
          if (isset($this->translationCache[$locale])) {
              return $this->translationCache[$locale];
          }
  
          if (!$this->exists) {
              return $this->translations()->newModelInstance(['locale' => $locale]);
          }
  
          return $this->translations()
              ->where('locale', $locale)
              ->firstOrNew(['locale' => $locale]);
      }
code: protected function translateOrNew(string $locale): Model
      {
          if (isset($this->translationCache[$locale])) {
              return $this->translationCache[$locale];
          }
  
          if (!$this->exists) {
              return $this->translations()->newModelInstance(['locale' => $locale]);
          }
  
          return $this->translations()
              ->where('locale', $locale)
              ->firstOrNew(['locale' => $locale]);
      }
code_tokens: protected function translateOrNew ( string $ locale ) : Model { if ( isset ( $ this -> translationCache [ $ locale ] ) ) { return $ this -> translationCache [ $ locale ] ; } if ( ! $ this -> exists ) { return $ this -> translations ( ) -> newModelInstance ( [ 'locale' => $ locale ] ) ; } return $ this -> translations ( ) -> where ( 'locale' , $ locale ) -> firstOrNew ( [ 'locale' => $ locale ] ) ; }
docstring: Get a translation or create new.
  
  @param string $locale
  
  @return \Illuminate\Database\Eloquent\Model
docstring_tokens: Get a translation or create new .