Default to 1 if no qty is passed

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-07-08 16:04:52 -07:00
parent 0a2a8932d4
commit f785c3e759

View file

@ -210,7 +210,7 @@ class ComponentsController extends Controller
$component->assets()->attach($component->id, [
'component_id' => $component->id,
'created_at' => \Carbon::now(),
'assigned_qty' => $request->get('assigned_qty'),
'assigned_qty' => $request->get('assigned_qty', 1),
'user_id' => \Auth::id(),
'asset_id' => $request->get('assigned_to')
]);