Lang::has PHP Method

has() public static method

Determine if a translation exists.
public static has ( string $key, string | null $locale = null, boolean $fallback = true ) : boolean
$key string
$locale string | null
$fallback boolean
return boolean
        public static function has($key, $locale = null, $fallback = true)
        {
            return \Illuminate\Translation\Translator::has($key, $locale, $fallback);
        }

Usage Example

Example #1
0
 public function typeTitle()
 {
     if (\Lang::has('CMS::users.user_types.' . $this->type)) {
         return trans('CMS::users.user_types.' . $this->type);
     }
     return ucwords($this->type);
 }
All Usage Examples Of Lang::has