mardi 11 décembre 2018

why did not search combine key words in Algolia in Laravel 5.6?

working with Laravel 5.6 and mysql and Algolia search. I have been using following vehicles table for searching key words,

id  name  categoryname  brandname    model     districtname provincename
1   juy   car           toyota       121       coba         nochiga
2   gty   van           nissan       caravan   natai        sara
3   bgh   car           bmw          520d      zenso        nayou
4   hyu   van           ford         max       mizuri       bakawa
5   nhj   car           toyota       121       nakaga       sara
6   gtr   car           toyota       corolla   wassa        nochiga
7   gtr   van           nissan       caravan   goa          jayui

this is my SearchingController function

$vehicles =  Vehicle::where('provincename', 'like', '%' . $request->get('search') . '%')-> orWhere('categoryname', 'like', '%' . $request->get('search') . '%')-> orWhere('districtname', 'like', '%' . $request->get('search') . '%')-> orWhere('brandname', 'like', '%' . $request->get('search') . '%')-> orWhere('modelname', 'like', '%' .  ->orderBy('adtype', 'DESC')->latest('updated_at') ->paginate(20);
            return view('vehicles.index', compact('vehicles'));
    }

this is work for only one key word on each columns like search car, bmw, toyota etc but when I use combine keys like bmw car car sarait is not getting results? no any error it is generate following commandno vehiclus display` this is my results generated blade file

 @forelse( $vehicles as $vehicule )

                <td>
                    @if( $vehicule->uploads->count() > 0 )
                        <a href="">
                            @php
                                $upload = $vehicule->uploads->sortByDesc('id')->first();
                            @endphp
                            <img src="/images/" ></a>
                        </a>  

                    @else
                        This vehicule does not have any images attached.
                         <!-- <img src="/images/noimage.png"> -->
                    @endif
                </td>
            @empty
                <td>No vehicules to display.</td>
            @endforelse

how can I fix this problem?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2QIvz3V
via IFTTT

Aucun commentaire:

Enregistrer un commentaire