I have problems with Laravel query. So I have a table that have 4 properties that I need to check, and table looks like:
product_id | partner_id | employer_id | type
So partner_id is setted in Config and there can be multiple different partners, as well as products and employers, type can be white or black. Employers are array so I need to check them with whereIn or whereNotIn.
So what I need to check is, where type is white, and not current partner and not current employers to list all rows from that table.
So I did something like
ProductListing::whereNotIn('employer_id', $employers)
->where('type', 'white')
->where('partner_id', '!=', $partner_id)
->pluck('product_id')
->toArray();
But this query is not working as expected. I should probably check every row for partner and then list whereNotIn, but I have no idea how. Any ideas how to fix it?