app/Services/SearchService.php
public function searchIndividualNames(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
    {
        $query = DB::table('individuals')
            ->join('name', static function (JoinClause $join): void {
                $join
                    ->on('name.n_file', '=', 'individuals.i_file')
                    ->on('name.n_id', '=', 'individuals.i_id');
            })
            ->orderBy('n_sort')
            ->select(['individuals.*', 'n_num']);

        $this->whereTrees($query, 'i_file', $trees);
        $this->whereSearch($query, 'n_full', $search);

        return $this->paginateQuery($query, Individual::rowMapper(), GedcomRecord::accessFilter(), $offset, $limit);
    }
public function searchIndividualNames(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
    {
        $query = DB::table('individuals')
            ->join('name', static function (JoinClause $join): void {
                $join
                    ->on('name.n_file', '=', 'individuals.i_file')
                    ->on('name.n_id', '=', 'individuals.i_id');
            })
            ->orderBy('n_sort')
            ->select(['individuals.*', 'n_num']);

        $this->whereTrees($query, 'i_file', $trees);
        $this->whereSearch($query, 'n_full', $search);

        return $this->paginateQuery($query, Individual::rowMapper(), GedcomRecord::accessFilter(), $offset, $limit);
    }
public function searchIndividualNames ( array $ trees , array $ search , int $ offset = 0 , int $ limit = PHP_INT_MAX ) : Collection { $ query = DB :: table ( 'individuals' ) -> join ( 'name' , static function ( JoinClause $ join ) : void { $ join -> on ( 'name.n_file' , '=' , 'individuals.i_file' ) -> on ( 'name.n_id' , '=' , 'individuals.i_id' ) ; } ) -> orderBy ( 'n_sort' ) -> select ( [ 'individuals.*' , 'n_num' ] ) ; $ this -> whereTrees ( $ query , 'i_file' , $ trees ) ; $ this -> whereSearch ( $ query , 'n_full' , $ search ) ; return $ this -> paginateQuery ( $ query , Individual :: rowMapper ( ) , GedcomRecord :: accessFilter ( ) , $ offset , $ limit ) ; }
Search for individuals by name.

@param Tree[]   $trees
@param string[] $search
@param int      $offset
@param int      $limit

@return Collection
@return Individual[]
Search for individuals by name .