I have sample code for get all trashed messages current user:
$query1 = $inbox->where('recipient', $user_id)
->where('trashed_in_recipient', 1)
->where('show_in_recipient', '!=', 1)
->orderBy('created_at', 'desc')
->paginate($paginate);
$query2 = $inbox->where('sender', $user_id)
->where('trashed_in_sender', 1)
->where('show_in_sender', '!=', 1)
->orderBy('created_at', 'desc')
->paginate($paginate);
How can be writed two query in one and get finally result?
Table structure:
