Get Activity with Where Custom Properties Doesn't Work #728
-
Hi, I've been log user's activity like login and logout like with this properties:
Then I am trying to get activity where type is 'auth' like this : Did I Do it wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, Activity::where('properties->type', 'auth')->get(); This will add a JSON field |
Beta Was this translation helpful? Give feedback.
Hey,
they issue is the order of your method calls. In your code-snippet you run the
where()
on the Eloquent Collection and not on the Eloquent Query-Builder.This will add a JSON field
WHERE
condition to the DB query and return a filtered Collection.