A couple things. Product should belongTo Invoice no?
I don't know what this code is supposed to do
$invoice->products($request->input('tab'));
If you want to save multiple records at once you need to call saveMany
so it would be
$products = [
Product::create(['field' => $value1]),
Product::create(['field' => $value2])
];
$invoice->products()->saveMany($products);
http://laravel.com/docs/4.2/eloquent#inserting-related-models
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community