title: Laravel : how to search multiple value from database
body: <p>On my search having <code>$categroy_id - $country_id - $city_id</code>. there is a table <code>activities</code> with all that value.</p>
  
  <p>I just implement a function in my controller but its return all data.</p>
  
  <p>My controller function code:</p>
  
  <pre><code>public function PlanActivity(Request $request){
      $category_id = $request-&gt;category_id;
      $countryid = $request-&gt;country_id;
      $cityid = $request-&gt;city_id;
      $listactivity = Activity::all(); // get all activity
      if($category_id != '') {
          $listactivity-&gt;where('category_id', function ($query) use ($category_id) {
              $query-&gt;where('category_id', $category_id);
          });
      }
  
      return view('front.plan_activity',compact('listactivity'));
  }
  </code></pre>
  
  <p>How can i do this?</p>