title: If condition based query in laravel
body: <p>I have a query as:</p>
  
  <pre><code> $Category = DB::table('food')
      -&gt;select('food.Food_id','food.FoodName','categories.CategoryName')
      -&gt;join('categories','categories.Category_id','=','food.Category_id')
      -&gt;where('categories.CategoryName', '=','Breakfast')
      -&gt;get();
  </code></pre>
  
  <p>But I want query based on if condition,meaning that if Category is Breakfast then only food items related to Breakfast are shown or IF Category is Lunch then only food items related to that category are shown.I am using <code>laravel 5.2</code></p>