lundi 29 février 2016

Searching in Laravel relationship for second table

I have two table having polymorphic relationships.

Table1 is history id|amount|type|created_at|updated_at

Table2 is accounts id|amount|account_number|accountable_id|accountable_type|created_at|updated_at

history have the summary of accounts table. accounts table is having polymorphic fields (accountable)

Now i am executing a query in history table results includes the accounts table also. The question is i want to search some data in accounts table too say payer name is in account table. So when i hit query on hitory table i will pass payer name with that so it can fetch only that accounts having the specific payer name.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire