public function deletePhoto($id) { try { $file = UserGallery::where('user_id', user()->user_id)->find($id); if ($file) { $file->delete(); return $this->rest()->success(array(), '删除成功'); } return $this->rest()->error('文件不存在'); } catch (\Exception $e) { return $this->rest()->error('删除失败'); } }