Muhammad Zaid Muhammad Zaid - 11 months ago 49
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();