1 year ago

Get all rows with specific ID

Posted 1 year ago by evripidesk

I am trying to get all raws (search) with specific ID with whereIn


public function searchHistory ()
       $this->validate(request(), [
         'q' => 'required',
            $q = Input::get ( 'q' );
            $id = Session::get('id');
            $clients = Clients::where('client_id', 'LIKE', $id)
                                      ->whereHas('user', function ($query) use ($q) {
                                        $query->where('name', 'like', "%{$q}%");})

but I get the following error "Invalid argument supplied for foreach()"

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