/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { FestivalActivities::find($id)->Festival()->detach(); $schedule = FestivalActivities::find($id); $a = FestivalActivities::where('id', $id)->delete(); $response = []; $response["events"] = $schedule->name; if ($a > trashed()) { $statusCode = 200; $response['result'] = "deleted"; } else { $statusCode = 422; $response['result'] = "Cannot delete."; } return Response::json($response, $statusCode); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Performer::find($id)->Festival()->detach(); $performer = Guest::find($id); $a = Performer::where('id', $id)->delete(); $response = []; $response["name"] = $performer->name; if ($a > trashed()) { $statusCode = 200; $response['result'] = "deleted"; } else { $statusCode = 422; $response['result'] = "Cannot delete."; } return Response::json($response, $statusCode); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Association::find($id)->Festival()->detach(); Association::find($id)->Person()->detach(); $ass = Association::find($id); $a = Association::where('id', $id)->delete(); $response = []; $response["name"] = $ass->name; if ($a > trashed()) { $statusCode = 200; $response['result'] = "deleted"; } else { $statusCode = 422; $response['result'] = "Cannot delete."; } return Response::json($response, $statusCode); }