From f622d6b087f4898067460de20ebd1740f0aad724 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Sun, 23 Dec 2018 10:00:52 -0500 Subject: [PATCH] convert bidder creation --- app/Http/Controllers/PagesController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index c24e41c..e4ab700 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -46,7 +46,10 @@ class PagesController extends Controller $bidder_phone = $bidder_req->bidderphone; $bidder_email = $bidder_req->bidderemail; $bidder_assigned_number = $bidder_req->biddernum; - $bidder_insert = DB::table('bidders')->insert( + $bidder_insert = Bidders::updateOrCreate( + [ + 'bidder_assigned_number' => $bidder_assigned_number, + ], [ 'bidder_lname' => $bidder_lname , 'bidder_fname' => $bidder_fname , @@ -55,9 +58,9 @@ class PagesController extends Controller 'bidder_state' => $bidder_state , 'bidder_zip' => $bidder_zip , 'bidder_phone' => $bidder_phone , - 'bidder_email' => $bidder_email , - 'bidder_assigned_number' => $bidder_assigned_number + 'bidder_email' => $bidder_email ]); + return redirect('bidders'); }