i have four table in database(sql):
customers Table:
id
name
credits Table:
id
name
count
customer_credit Table (pivot table):
customer_id
credit_id
expiry_date
consumers Table:
id
customer_id
this is the SPA application(Web base) with laravel. how to received (only login customers) records from consumers table who conditions in customer_credit table available records without expire date for we can computing remaining credits. more explain is we are trying to gathering entrance and exit logs from guests in our pool and gym and we want to gets count in credits table who exact customer_credit table id .