I'm trying to submit a simple form but it's not redirecting or anything.
Code:
@foreach($admins as $admin)
<form method="post" action="/admin/medewerkers">
{{csrf_field()}}
<input type="text" value="{{$admin->id}}" name="userid" hidden>
<tr>
<td>{{$admin->name}}</td>
<td>{{$admin->email}}</td>
<td><a data-target="#myModal{{$admin->id}}" data-toggle="modal"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> </a> </td>
<td> <button type="submit" class="btn btn-xs btn-danger" name="delete" id="delete"> Delete </button></td>
</tr>
</form>
@endforeach
Simple backend
public function update(Request $request)
{
if (isset($_POST['delete'])) {
echo 'delete';
}
}
What am i doing wrong here? Thanks!