I am deleting and editing in a simple crud with laravel 5.7 but when using a resource path with its respective edit and delete methods (edit and destroy respectively), the method in question does not receive the id argument that I am passing: codes are these:
View:
<form action="{{route('events.destroy',$event->id)}}" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Eliminar</button>
</form>
Route:
Route::resource('events', 'EventController');
Controller:
public function destroy($id)
{
dd($id);
}
The variable $ event receives the id, I'm going through each record with a foreach ... and probe and if it is sending the variable but the method does not receive the error is this: