Muhammad Zaid Muhammad Zaid - 1 year ago 89
PHP Question

Laravel Destroy() is not removing any record from DB

Database Image

This is my controller's index method. When i run the code it does nothing.

public function index()
return view('customer');


<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Customer extends Model {
protected $guarded = [];
public $timestamps=false;

Answer Source

Try using delete instead of destroy like this:


or you can try directly from database using eloquent query builder:

Customer::where('id', 1)->delete();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download