tanveerkhanwd
9 months ago
142
4
Laravel

how i search data from multiple colunm in database using array

Posted 9 months ago by tanveerkhanwd

my controler:

        
        $aCon= array();
        if (!empty($request->input('search'))) {
            $aCon['name'] = $search;
            $aCon['city'] = $search;
            $aCon['present_school'] = $search;
        }
        $records = config('constant.displayPageRecords');
        $admission = Admission::where($aCon,'like','%'.$search.'%')->paginate($records);
        return view('admin.admission.index',['admission'=>$admission,'records'=>$records]);

Please sign in or create an account to participate in this conversation.