8 months ago

Method not allowed when delete record in laravel

Posted 8 months ago by sanjayacloud

Hello Friends,

I have got some error "Method not allowed " when delete record. My Delete method like this,

 public function destroy(Request $request, $id)
        $data = Product::findOrFail($id);
        return redirect('/product/index');

And my for like below,

<form action=""{{url('product/destroy/'.$row->id)}} method="post">
     <button type="submit" class="btn btn-outline-danger btn-block">Delete</button>

My route like this,

   Route::post('/product/destroy/{id}','[email protected]');

Any one have any idea about this error?

Please sign in or create an account to participate in this conversation.