Firstly, I am sure this is a typo, but in your SQL example, 'notifications' is not a variable '$notifications'
Secondly, what you are doing here is re-assigning the variable '$notifications' . Depending on the results you are getting from your first query, you might want to try this:
$notifications = $notifications->where('volcano_id', '=', $id)->get();
This is then querying the results of your DB::select.
Notifications::where... Is basically query the DB again, so you are doubling up.
You are also checking $id twice. If your first query is right, then you won't need the second I don't think.
Hopefully that makes sense?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community