In my query I check if tokens.id exists in dapp_tokens. I want to add that the result in dapp_tokens also has to be active = 1 in the dapps table. So I need to join the dapps table of the row with tokens.id that has been found in dapp_tokens but how can I do that in Raw SQL?
$data['tokens'] = Token::where('active', 1)
->whereRaw('tokens.id in (select token_id from dapp_tokens where active = ?)', )
from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/3kAao0C