I have query below:

```
$address = Address::where('id', $request->input('address_id'))->first();
$state = $address->state_id;

$mytime = Carbon::now();
$mytax = Tax::where('province_id', $state)
  ->where('validation', '=', 'active')
  ->where('valid_to', '>=', $mytime)
  ->first();

```

This simply check my taxes table and if expired date hasn't reached yet returns data. It's working perfectly **but the issue is that I have 2 conditions** and *this query only returns one of them*.

### Conditions

1. Time based tax (query above)
2. Permanent tax which doesn't rely on dates (that part I don't have yet)

Logic
=====

1. Find tax based on `province_id` (first part of my query)
2. If no.1 passed, check `validation` column if is set to `active`
means is time based and needs `->where('valid_to', '>=', $mytime)`
part if is set to `inactive` it's not time based and always should
return the data (in case there is any in database)

**Any idea how can I check `validation` column value before actually go for date validation?**