original_string: protected function getTranslation(string $locale): ?Model
      {
          if (isset($this->translationCache[$locale])) {
              return $this->translationCache[$locale];
          }
  
          if (!$this->exists) {
              return null;
          }
  
          $translation = $this->translations
              ->where('locale', $locale)
              ->first();
  
          if ($translation) {
              $this->translationCache[$locale] = $translation;
          }
  
          return $translation;
      }
code: protected function getTranslation(string $locale): ?Model
      {
          if (isset($this->translationCache[$locale])) {
              return $this->translationCache[$locale];
          }
  
          if (!$this->exists) {
              return null;
          }
  
          $translation = $this->translations
              ->where('locale', $locale)
              ->first();
  
          if ($translation) {
              $this->translationCache[$locale] = $translation;
          }
  
          return $translation;
      }
code_tokens: protected function getTranslation ( string $ locale ) : ? Model { if ( isset ( $ this -> translationCache [ $ locale ] ) ) { return $ this -> translationCache [ $ locale ] ; } if ( ! $ this -> exists ) { return null ; } $ translation = $ this -> translations -> where ( 'locale' , $ locale ) -> first ( ) ; if ( $ translation ) { $ this -> translationCache [ $ locale ] = $ translation ; } return $ translation ; }
docstring: Get a translation from cache, loaded relation, or database.
  
  @param string $locale
  
  @return \Illuminate\Database\Eloquent\Model|null
docstring_tokens: Get a translation from cache loaded relation or database .