public function deleteBatchById() { $inputs['batch_id'] = Input::get('batch_id'); // deleting from batch_schedule table $batchSchedule_delete = BatchSchedule::deleteBatchScheduleById($inputs['batch_id']); if ($batchSchedule_delete) { // deleting from batch table $batch_delete = Batches::deleteBatchById($inputs['batch_id']); if ($batch_delete) { return Response::json(array('status' => 'success')); } else { return Response::json(array('status' => 'failure')); } } return Response::json(array('status' => 'failure')); }