In this case, if I change exp_at, than id_card will be from one field, and exp_at from another.. And if I use where statement for card, than user records disaper. how to solve???
->leftJoin('bon_card', 'bon_card.id_user', '=', 'users.id_user')
->select(DB::raw('max(bon_card.id_card) as id_card, max(bon_card.exp_at) as bon_exp_date, users.*'))
->where([['vards','LIKE',"%{$vards}%"], ['uzvards','LIKE',"%{$uzvards}%"], ['pers_kods','LIKE',"%{$pers_kods}%"], ['tel','LIKE',"%{$tel}%"], ['email','LIKE',"%{$email}%"]])