public function data() { $batchesBuilder = $this->repo->search('', false); return Datatables::of($batchesBuilder)->addColumn('actions', function ($model) { return '<a class="btn default btn-xs purple" href="/batches/' . $model->id . '/edit' . '"><i class="fa fa-edit"></i> Editar </a> <a href="/batches/' . $model->id . '/delete' . '" class="btn btn-xs red"><i class="glyphicon glyphicon-trash"></i> </a>'; })->make(true); }
/** * Remove the specified Batch from storage. * DELETE /batches/{id} * * @param int $id * * @return Response */ public function destroy($id) { $this->batchRepository->apiDeleteOrFail($id); return $this->sendResponse($id, "Batch deleted successfully"); }