repository = $repository; } /** * @param string $key * @return mixed * @author zfy * @day 2020-04-22 */ public function save($key) { $formData = $this->request->post(); if (!count($formData)) return app('json')->fail('保存失败'); /** @var ConfigClassifyRepository $make */ $make = app()->make(ConfigClassifyRepository::class); if (!($cid = $make->keyById($key))) return app('json')->fail('保存失败'); $this->repository->save($cid, $formData, $this->request->merId()); return app('json')->success('保存成功'); } }