From bd38d64e66fa0f66a3b89915d7ceb2420234f6df Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 3 Dec 2024 21:28:33 +0000 Subject: [PATCH] Removed create() method Signed-off-by: snipe --- .../Accessories/AccessoryCheckoutController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoryCheckoutController.php b/app/Http/Controllers/Accessories/AccessoryCheckoutController.php index 2417f16567..7a76d3c544 100644 --- a/app/Http/Controllers/Accessories/AccessoryCheckoutController.php +++ b/app/Http/Controllers/Accessories/AccessoryCheckoutController.php @@ -75,14 +75,17 @@ class AccessoryCheckoutController extends Controller $accessory->checkout_qty = $request->input('checkout_qty', 1); for ($i = 0; $i < $accessory->checkout_qty; $i++) { - AccessoryCheckout::create([ + + $accessory_checkout = new AccessoryCheckout([ 'accessory_id' => $accessory->id, 'created_at' => Carbon::now(), - 'created_by' => auth()->id(), 'assigned_to' => $target->id, 'assigned_type' => $target::class, 'note' => $request->input('note'), ]); + + $accessory_checkout->created_by = auth()->id(); + $accessory_checkout->save(); } event(new CheckoutableCheckedOut($accessory, $target, auth()->user(), $request->input('note')));