/** * Execute the job. * * @return bool */ public function handle() { $this->category->name = $this->request->input('name'); $this->category->options = ['manager' => $this->request->has('manager')]; $this->category->parent_id = $this->request->parent; return $this->category->save(); }
/** * Execute the job. * * @return bool */ public function handle() { $this->category->name = $this->request->input('name'); $this->category->belongs_to = 'inquiries'; $this->category->options = ['manager' => $this->request->has('manager')]; if ($this->request->has('parent')) { $this->category->parent_id = $this->request->input('parent'); } if ($this->category->save()) { if ($this->parent instanceof Category) { $this->category->parent()->associate($this->parent); } return true; } return false; }