Example #1
0
 /**
  * @param $id
  * @param $attributes
  *
  * @return bool|mixed
  *
  * @throws \Fully\Exceptions\Validation\ValidationException
  */
 public function update($id, $attributes)
 {
     $attributes['is_published'] = isset($attributes['is_published']) ? true : false;
     $this->page = $this->find($id);
     if ($this->isValid($attributes)) {
         $this->page->resluggify();
         $this->page->fill($attributes)->save();
         return true;
     }
     throw new ValidationException('Category validation failed', $this->getErrors());
 }