/** * Saves an item * * When the class variable $item it will try to save it, if an own item is not provided * * @param array $item A creation array * * @return boolean The result of the insert **/ public function save($item = null) { $exists = $this->builder->where('name', '=', $item['name'])->first(); if ($exists) { return false; } parent::save($item); }
/** * Saves an item * * When the class variable $item it will try to save it, if an own item is not provided * * @param array $item A creation array * * @return boolean The result of the insert **/ public function save($item = null) { $exists = $this->builder->where('plugin', $item['plugin'])->where('category', $item['category'])->first(); if ((bool) $exists) { return false; } return parent::save($item); }