I have my codes in the session, and I wanted to make a select in the query by taking the session codes as a condition, and then sending the information to the view
session()->push('session_cart', $id);
$result= DB::select('select * from products where id in (?)',[session()]);
return view('list', compact('result'));
session()->push('session_cart', $id);
$result= DB::select('select * from products where id in (?)',[session()]);
return view('list', compact('result'));
So I'm guessing session_cart is an array of product ids?
Have you checked that?
Is there a good reason you don't use Eloquent or Query Builder?
Exactly, the session_cart are product IDs, but I do not know how to do the select with these IDs, I'm learning Laravel and I do not know how to use these Eloquent or Query Builder, how would I do this select?