Support the ongoing development of Laravel.io →
posted 10 years ago
Eloquent
Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

montes2012 montes2012 Joined 11 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.