A free open source IT asset/license management system
Use a transaction while creating license seats. Makes adding a license with a large number of seats much more managable.
Daniel Meltzer45d93ffa8c42
diff --git a/app/Http/Controllers/LicensesController.php b/app/Http/Controllers/LicensesController.phpindex ef17637a3b..b1db080758 100755--- a/app/Http/Controllers/LicensesController.php+++ b/app/Http/Controllers/LicensesController.php@@ -156,6 +156,7 @@ class LicensesController extends Controller$insertedId = $license->id;// Save the license seat data+ DB::transaction(function() use (&$insertedId,&$license) {for ($x=0; $x<$license->seats; $x++) {$license_seat = new LicenseSeat();$license_seat->license_id = $insertedId;@@ -164,6 +165,7 @@ class LicensesController extends Controller$license_seat->notes = null;$license_seat->save();}+ });// Redirect to the new license page