本文整理汇总了PHP中Customer::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::destroy方法的具体用法?PHP Customer::destroy怎么用?PHP Customer::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::destroy方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminDeleteCustomers
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);
}
示例2: destroy
/**
* 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');
}
示例3: destroy
/**
* 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');
}
示例4: delete
/**
* 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();
}
示例5: destroy
public function destroy($id)
{
Customer::destroy($id);
return Redirect::route('customers_path');
}
示例6: destroy
/**
* Remove the specified customer from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Customer::destroy($id);
return Redirect::route('admin.customers.index');
}
示例7: switch
<?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;
}
?>
示例8: destroy
/**
* Remove the specified product from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Customer::destroy($id);
return Response::json(array('success' => true));
}