Shiva
6 months ago

Getting a value from a cell in a database

Posted 6 months ago by Shiva

In my form I have a textbox that I can add multiple codes to, for example: sup_1, sup_2, sup_3. And I save the as a string in the database.

What I'm struggling with is that I just want to get just one of the codes and then see what is in that row.

I'm doing this

 public function getAddItem($supplier_code)
{
    $product = Product::where('supplier_code', $supplier_code)->get();
    
    dd($product);

    return redirect()->back();
}

So the aim is to look for the supplier_code in the table and grab that info.

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