Loyalty Cards List

Retrieves a list of loyalty cards associated with a specific loyalty program. It first generates a cache key based on the loyalty program ID. Then, it defines a closure that queries the database to fetch loyalty cards related to the loyalty program. It eagerly loads relationships with premium cards and next cards. The function applies a filter to exclude cards tagged as disabled for users. It then maps the retrieved cards and returns the result.

Language
Credentials
Header
Click Try It! to start a request and see the response here!