... Either that or I'm not using / understanding it correctly. Take a look at my test snippet:
$subscriptions = auth()->user()->subscriptions()->get();
$id = '40';
$test = $subscriptions->filter(function ($subscription) use ($id) {
return $subscription->where('description_id', $id);
});
dd($test);
Currently there is one Subscription
in the database, with a description_id
of 20. When running the above test snippet, I still get the one result returned that has a description_id
of 20. So, this is not an expected result. What am I doing wrong?