I'm not sure if my title is correctly done, but what I'm trying to do is get all the notifications that a user didn't read. I have 2 tables the first table is notifications and the second one is read_notifications.
Here is my code in User.php model
$read = DB::table('read_notifications')->select('notification_id')->where('user_id', $this->id)->get();
$unread = Notification::whereNotIn('id', $read)->get();
Here I'm getting all the notification IDs in the read_notifications table and I want to put them in the $unread
statement.
The error I get when I do this is
Object of class stdClass could not be converted to string