1 year ago

Difference between two apparently similar queries.

Posted 1 year ago by francoboy7

Hi everyone,

could someone tell me the difference between these 2 queries ? The first one did not work and the second one works flawlessly...

***Note : ***$lodging->favorites() reference a hasMany relation.

$lodging->favorites()->where('user_id', auth()->id())->get()->first()->delete();

$lodging->favorites()->get()->where('user_id', auth()->id())->first()->delete();


Please sign in or create an account to participate in this conversation.