public function destroy($id) { $cover = Cover::find($id); $cover->delete(); flash()->success('删除成功'); return redirect()->back(); }
public function update(array $data, $id) { $cover = Cover::find($id); $cover->name = $data['name']; $cover->cover_url = $data['cover_url']; $cover->display = $data['display']; $cover->save(); return $cover; }