app/Services/SearchService.php
private function wherePhonetic(Builder $query, $field, string $soundex): void
    {
        if ($soundex !== '') {
            $query->where(static function (Builder $query) use ($soundex, $field): void {
                foreach (explode(':', $soundex) as $sdx) {
                    $query->orWhere($field, 'LIKE', '%' . $sdx . '%');
                }
            });
        }
    }
private function wherePhonetic(Builder $query, $field, string $soundex): void
    {
        if ($soundex !== '') {
            $query->where(static function (Builder $query) use ($soundex, $field): void {
                foreach (explode(':', $soundex) as $sdx) {
                    $query->orWhere($field, 'LIKE', '%' . $sdx . '%');
                }
            });
        }
    }
private function wherePhonetic ( Builder $ query , $ field , string $ soundex ) : void { if ( $ soundex !== '' ) { $ query -> where ( static function ( Builder $ query ) use ( $ soundex , $ field ) : void { foreach ( explode ( ':' , $ soundex ) as $ sdx ) { $ query -> orWhere ( $ field , 'LIKE' , '%' . $ sdx . '%' ) ; } } ) ; } }
Apply soundex search filters to a SQL query column.

@param Builder           $query
@param Expression|string $field
@param string            $soundex
Apply soundex search filters to a SQL query column .