Skip to content

Commit

Permalink
Add reset to the final placeOrder function
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Jun 10, 2024
1 parent 1dc22cc commit c587594
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/Http/Controllers/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public function orderCreate(): void
{
$orderData = session('orderData');
dd($orderData);
//array:5 [▼ // app/Http/Controllers/PagesController.php:22
// "user_id" => null
// "title" => null
// "description" => null
// "total_price" => 28
// "status" => "pending"
//]

}

public function contact(): View
Expand Down
4 changes: 3 additions & 1 deletion app/Livewire/PriceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function closeModal(): void
public function placeOrder()
{
// Logic to create the order
$this->reset(['topic', 'subject', 'word_count']);
$this->closeModal();

$orderData = [
Expand All @@ -91,6 +90,9 @@ public function placeOrder()
// Store the order in the session
session(['orderData' => $orderData]);

// Reset the form fields
$this->reset(['topic', 'subject', 'word_count']);

// redirect to the order creation page
return redirect()->route('orders.create.new');
}
Expand Down

0 comments on commit c587594

Please sign in to comment.