From 8dec419f93edf252701ad9cd1a0590f29639bf4e Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Thu, 7 Dec 2023 14:23:44 +0300 Subject: [PATCH] fix error plan --- app/Livewire/Plan/Create.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Livewire/Plan/Create.php b/app/Livewire/Plan/Create.php index d9d0e85..dc73888 100644 --- a/app/Livewire/Plan/Create.php +++ b/app/Livewire/Plan/Create.php @@ -85,21 +85,21 @@ class Create extends Component $plan = new Plan(); - $plan->name = $this->name; - $plan->image = $this->image->store('plans', 'public'); - $plan->duration = $this->duration; - $plan->state = $this->state; - $plan->details = $this->details; - $plan->packets_count = $this->packets_count; - $plan->type = json_encode($this->type); - $plan->packet1_options = json_encode($this->packet1_options); - $plan->packet2_options = json_encode($this->packet2_options); - $plan->packet3_options = json_encode($this->packet3_options); - $plan->plan->saveOrFail(); + $this->name = $plan->name; + $this->image = $plan->image->store('plans', 'public'); + $this->duration = $plan->duration; + $this->state = $plan->state; + $this->details = $plan->details; + $this->packets_count = $plan->packets_count; + $this->type = json_encode($plan->type); + $this->packet1_options = json_encode($plan->packet1_options); + $this->packet2_options = json_encode($plan->packet2_options); + $this->packet3_options = json_encode($plan->packet3_options); + $plan->saveOrFail(); $user = Auth::user(); - $user->author_of_plans()->attach($this->id); + $user->author_of_plans()->attach($plan->id); - return redirect()->route('plan.show', $this->id); + return redirect()->route('plan.show', $plan->id); } public function addToDrafts()