src/Models/Term.php
public function getDisplayName($locale = '', $limit = 0)
    {
        $locale = $locale ?: app()->getLocale();

        $property_with_locale = $locale === 'en' ? "name" : "name_$locale";

        $name = property_exists($this, $property_with_locale) ? $this->{$property_with_locale} : $this->name;

        return $limit > 0 ? str_limit($name, $limit) : $name;
    }
public function getDisplayName($locale = '', $limit = 0)
    {
        $locale = $locale ?: app()->getLocale();

        $property_with_locale = $locale === 'en' ? "name" : "name_$locale";

        $name = property_exists($this, $property_with_locale) ? $this->{$property_with_locale} : $this->name;

        return $limit > 0 ? str_limit($name, $limit) : $name;
    }
public function getDisplayName ( $ locale = '' , $ limit = 0 ) { $ locale = $ locale ? : app ( ) -> getLocale ( ) ; $ property_with_locale = $ locale === 'en' ? "name" : "name_$locale" ; $ name = property_exists ( $ this , $ property_with_locale ) ? $ this -> { $ property_with_locale } : $ this -> name ; return $ limit > 0 ? str_limit ( $ name , $ limit ) : $ name ; }
Get display name.

@param  string  $locale
@param  int     $limit
@return mixed
Get display name .