I can add on item which is 'product_id' in each import my question is How to add multiple product ids with multiple quantities in the same record and not one id ?
Schema::create('imports', function (Blueprint $table) {
$table->id();
$table->bigInteger('supplier_id');
$table->bigInteger('branch_id');
$table->bigInteger('product_id');
$table->bigInteger('quantity');
$table->double('cost',null,2);
$table->timestamps();
});
Controller
$import = new Import();
$import->supplier_id = $request->supplier_id;
$import->branch_id = $request->branch_id;
$import->product_id = $request->product_id;
$import->quantity = $request->quantity;
$import->cost = $request->cost;
$import->save();