Skip to content Skip to sidebar Skip to footer

Laravel Delete Forms

I am building a HTML table with laravel of data from my database query and in the last column of the table it should be displaying an edit link and a delete link. The edit link wor

Solution 1:

You can actually use a form for the delete button and use custom styling, here's a working example:

<form action="{{ route('yourmodels.destroy', $yourmodel->id) }}" method="POST">
 {{ method_field('DELETE') }}
 {{ csrf_field() }}
<button type='submit' style="   
    background: none;
    color: #9aa0ac;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;" >
 <i class="fe fe-trash-2"></i></button>
</form>

Post a Comment for "Laravel Delete Forms"