title: Filter record by using array - Laravel
body: <p>I have a collection and I want to filter that collection based upon "days_since_last_wallet_transaction" by using an array. For example, I have an array $day = array(2,4,6,8). Now I want to get the record where days_since_last_wallet_transaction is in 2,4,6,8. I think I cannot use "days_since_last_wallet_transaction" in where clause. Here is my query:</p>
  
  <pre><code>Customer::select(
                  'customers.id',
                  'customers.wallet_amount',
                  'customers.onesignal_id',
                  'customers.phone_number',
                  'customers.name',
                  DB::raw('DATEDIFF(NOW(), max(wallet_transactions.created_at)) as days_since_last_wallet_transaction')
              )
              -&gt;join('wallet_transactions', function ($join){
                  $join-&gt;on('customers.id', '=', 'wallet_transactions.customer_id')
                  -&gt;where('wallet_transactions.amount', '&gt;', 0);
              })
              -&gt;groupBy('customers.id')
              -&gt;where('customers.wallet_amount', '&gt;', 0);
  </code></pre>
  
  <p>Any help would be highly appreciable. </p>