Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function destroy($id)
- {
- $category = Category::findOrFail($id);
- $image = Storage::disk('local')->delete('public/categories/'.$category->image);
- $category->delete();
- if($category){
- return response()->json(['status' => 'success']);
- } else {
- return response()->json(['status' => 'error']);
- }
- }
Add Comment
Please, Sign In to add comment