I have a very simple table with different buttons on each line that are all blade components, each of these generate a form with a submit button to redirect to another page.
Yet for some reason my “x-buttons.delete” component only generate the tag and not the form.
I know I could just remove the not-working form and put a tag in the button but I’m still wondering why is it doing that?
Here’s how the component is called in the table
<td>
<x-buttons.delete class="" route="{{route('censored.delete',['id'=>$censored->id])}}"></x-buttons.delete>
</td>
Here’s what’s inside the component
<form method="post" action="{{$route}}">
@csrf
<button class="btn btn-danger btn-sm {{$class}}" type="submit">
{!! $slot=='' ? '<i class="fa fa-trash"></i>' : $slot !!}
</button>
</form>
Every other buttons on the table is the same, only difference is the route and the fontawesome icon
Asnard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.