fix error plan

This commit is contained in:
2023-12-07 14:23:44 +03:00
parent e57c1e63e7
commit 8dec419f93

View File

@@ -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()