public function adminDeleteCustomers() { $id = Input::get('javascriptArrayString'); //if( Customer::find($id)->customerlog ) $hasRecord = Customer::find($id)->customerlog()->lists('id'); Customer::destroy($id); $data['status'] = 'success'; $data['message'] = 'Customer\'s record deleted successfully'; return Response::json($data); }
/** * Remove the specified resource from storage. * DELETE /customers/{id} * * @param int $id * @return Response */ public function destroy($id) { Customer::destroy($id); return Redirect::route('customers.index')->with('message', 'Deleted customer')->with('alert-class', 'success'); }
/** * Remove the specified customer from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($pj = Penjualan::where('customer_id', '=', $id)->first()) { $pjid = $pj->id; DetailPenjualan::where('penjualan_id', '=', $pjid)->delete(); } Penjualan::where('customer_id', '=', $id)->delete(); Customer::destroy($id); return Redirect::to('admin/customer/tipe/1')->with('message', 'berhasil menghapus customer'); }
/** * Remove the specified resource from storage. * DELETE /adminbuildings/{id} * * @param int $id * @return Response */ public function delete($id) { $customer = Customer::find($id); $public_path = public_path() . $this->public_path; $image_fields = $this->image_fields; for ($i = 0; $i < count($image_fields); $i++) { if (file_exists($public_path . $customer->{$image_fields}[$i])) { File::delete($public_path . $customer->{$image_fields}[$i]); } } Customer::destroy($id); return Redirect::back(); }
public function destroy($id) { Customer::destroy($id); return Redirect::route('customers_path'); }
/** * Remove the specified customer from storage. * * @param int $id * @return Response */ public function destroy($id) { Customer::destroy($id); return Redirect::route('admin.customers.index'); }
<?php $action = $_REQUEST['action']; $handler->loadModel('customer_m'); $customer = new Customer; switch ($action){ case 'read': echo $customer->read($_POST); break; case 'create': echo $customer->create($_POST['data']); break; case 'update': echo $customer->update($_POST['data']); break; case 'destroy': echo $customer->destroy($_POST['data']); break; } ?>
/** * Remove the specified product from storage. * * @param int $id * @return Response */ public function destroy($id) { Customer::destroy($id); return Response::json(array('success' => true)); }