original_string: public static function firstByName(string $tag, string $group = null, string $locale = null)
      {
          $locale = $locale ?? app()->getLocale();
  
          return static::query()->where("name->{$locale}", $tag)->when($group, function (Builder $builder) use ($group) {
              return $builder->where('group', $group);
          })->first();
      }
code: public static function firstByName(string $tag, string $group = null, string $locale = null)
      {
          $locale = $locale ?? app()->getLocale();
  
          return static::query()->where("name->{$locale}", $tag)->when($group, function (Builder $builder) use ($group) {
              return $builder->where('group', $group);
          })->first();
      }
code_tokens: public static function firstByName ( string $ tag , string $ group = null , string $ locale = null ) { $ locale = $ locale ?? app ( ) -> getLocale ( ) ; return static :: query ( ) -> where ( "name->{$locale}" , $ tag ) -> when ( $ group , function ( Builder $ builder ) use ( $ group ) { return $ builder -> where ( 'group' , $ group ) ; } ) -> first ( ) ; }
docstring: Get first tag by name.
  
  @param string      $tag
  @param string|null $group
  @param string|null $locale
  
  @return static|null
docstring_tokens: Get first tag by name .