all()); return new CollectionResource($collection); } public function update(Request $request, Collection $collection) { $collection->update($request->all()); return new CollectionResource($collection); } public function destroy(Collection $collection) { if ($collection->trashed()) { return $collection->restore(); } return $collection->delete(); } }