vendredi 26 novembre 2021

real-time data finder - search with multiple models

i need to make my search engine work with multiple data tables

right now get data from the model "Registro".

    public function buscador(){
        
        return view('posts.index');
        
    }
        public function search(Request $request){
            
            $results = Registro::where('cliente', 'LIKE', "%{$request->search}%")->get();
            
            return view('posts.results', compact('results'))->with(['search' => $request->search])->render();
            
        }
        public function show(Request $request){
            
            $post = Registro::findOrFail($request->id);
            return view('posts.post', compact('post'))->render();
            
       
    
}

can search with multiple models?



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

Aucun commentaire:

Enregistrer un commentaire