laravel 5搜索查询问题

I need to search filtering different columns from DB table, those filtering columns are groupA, groupb and groupC, each column has one of following values high, low, moderate in db table

But front end user have anther value called "none", but that value is not contain in database.

This is my current query

  public function show($groupA, $groupB, $groupC)
    {
        $FodMaps = FodMap::where('groupA', '=', $groupA)->where('groupB', '=', $groupB)->where('groupC', '=', $groupC)->get();
        return $FodMaps;


    }

What I want is if user search with value which does not contain in db (high/low/moderate) it should search the other columns except the one which have unmatching values

ex: http://url/api/fodmap/groupA=low/groupB=low/groupC=high

if user enter above way it should display the results according to the values

but if user inputs like following

http://url/api/fodmap/groupA=low/groupB=low/groupC=none

since "none" value in groupC column does not exit it should search only other two columns without considering the value of groupC

please advice

You can add query condition dynamically like this.



    public function show($groupA, $groupB, $groupC)
    {
        $query = FodMap::query();
        if ($groupA !== 'none') {
          $query->where('groupA', '=', $groupA)
        }

        if ($groupB !== 'none') {
          $query->where('groupB', '=', $groupB)
        }

        if ($groupC !== 'none') {
          $query->where('groupC', '=', $groupC)
        }

        return $query->get();
    }