Jam0r
2 years ago

How to use function in eloquent query?

Posted 2 years ago by Jam0r

I've seen this done but can't figure it out in my head.

When querying an eloquent model, say it has an method called 'isLive()' which contains a number of checks to determine whether the item is live or not.

Rather than store this as an element in the database, how do I go about querying the model using the 'isLive()' function to filter through results?

Please sign in or create an account to participate in this conversation.