This is my route
Route::delete('/customer_page/summary/{id}', 'ReservationController@delete_cart');
My controller function
public function delete_cart($id)
{
cart::findOrFail($id)->delete();
return redirect('/customer_page/summary');
}
My form
@foreach($cart as $key => $val)
<tr>
<td>{{ $val->room_type }}</td>
<td>{{ $val->number_of_rooms }}</td>
<td>{{ $val->price }}</td>
<td>
<form action="/customer_page/summary/{{ $val->id }}" method="post">
{{ csrf_field() }}
<input type="hidden" name="_method" value="DELETE" />
<button type="submit" class="btn waves-effect red"><i class="material-icons">delete</i>delete</button>
</form>
</td>
</tr>
@endforeach
I don't know why I always keep getting that error
/
from your 'action' – Oluwatobi Samuel Omisakin