/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $repair = Repair::where('user_id', Auth::user()->id)->find($id); if ($repair === null) { return response()->json(['status' => 2]); } $repair->status = Category::getCategoryId('repair.status', 'canceled'); $result = $repair->save(); return response()->json(['status' => $result === true ? 0 : 2]); }