app/Services/IndividualListService.php
private function whereInitial(Builder $query, string $field, string $letter, string $locale, string $collation): void
    {
        // Use MySQL-specific comments so we can run these queries on other RDBMS.
        $field_with_collation = $this->fieldWithCollation($field, $collation);

        switch ($locale) {
            case 'cs':
                $this->whereInitialCzech($query, $field_with_collation, $letter);
                break;

            case 'da':
            case 'nb':
            case 'nn':
                $this->whereInitialNorwegian($query, $field_with_collation, $letter);
                break;

            case 'sv':
            case 'fi':
                $this->whereInitialSwedish($query, $field_with_collation, $letter);
                break;

            case 'hu':
                $this->whereInitialHungarian($query, $field_with_collation, $letter);
                break;

            case 'nl':
                $this->whereInitialDutch($query, $field_with_collation, $letter);
                break;

            default:
                $query->where($field_with_collation, 'LIKE', '\\' . $letter . '%');
        }
    }
private function whereInitial(Builder $query, string $field, string $letter, string $locale, string $collation): void
    {
        // Use MySQL-specific comments so we can run these queries on other RDBMS.
        $field_with_collation = $this->fieldWithCollation($field, $collation);

        switch ($locale) {
            case 'cs':
                $this->whereInitialCzech($query, $field_with_collation, $letter);
                break;

            case 'da':
            case 'nb':
            case 'nn':
                $this->whereInitialNorwegian($query, $field_with_collation, $letter);
                break;

            case 'sv':
            case 'fi':
                $this->whereInitialSwedish($query, $field_with_collation, $letter);
                break;

            case 'hu':
                $this->whereInitialHungarian($query, $field_with_collation, $letter);
                break;

            case 'nl':
                $this->whereInitialDutch($query, $field_with_collation, $letter);
                break;

            default:
                $query->where($field_with_collation, 'LIKE', '\\' . $letter . '%');
        }
    }
private function whereInitial ( Builder $ query , string $ field , string $ letter , string $ locale , string $ collation ) : void { // Use MySQL-specific comments so we can run these queries on other RDBMS. $ field_with_collation = $ this -> fieldWithCollation ( $ field , $ collation ) ; switch ( $ locale ) { case 'cs' : $ this -> whereInitialCzech ( $ query , $ field_with_collation , $ letter ) ; break ; case 'da' : case 'nb' : case 'nn' : $ this -> whereInitialNorwegian ( $ query , $ field_with_collation , $ letter ) ; break ; case 'sv' : case 'fi' : $ this -> whereInitialSwedish ( $ query , $ field_with_collation , $ letter ) ; break ; case 'hu' : $ this -> whereInitialHungarian ( $ query , $ field_with_collation , $ letter ) ; break ; case 'nl' : $ this -> whereInitialDutch ( $ query , $ field_with_collation , $ letter ) ; break ; default : $ query -> where ( $ field_with_collation , 'LIKE' , '\\' . $ letter . '%' ) ; } }
Modify a query to restrict a field to a given initial letter.
Take account of digraphs, equialent letters, etc.

@param Builder $query
@param string  $field
@param string  $letter
@param string  $locale
@param string  $collation

@return void
Modify a query to restrict a field to a given initial letter . Take account of digraphs equialent letters etc .