/** * @param $id * @return \Illuminate\Http\JsonResponse */ public function getEditCate($id) { $data = $this->category->find($id); if ($data->thumb > 0) { $thumb = Uploader::where('id', $data->thumb)->select(['id', 'name', 'path'])->first(); $data->thumb = $thumb ? $thumb : ''; } return Response::json(['data' => $data]); }