l2t

How to use delete method in Laravel?

Asked: a month ago

If you want to use delete form method in laravel here is the snippet code.

<form method="post" action="{{ route('admin.urls.delete') }}">
    @csrf
    @method('delete')
    <a href="{{ route('admin.urls.delete') }}" 
        class="btn btn-sm pd-x-15 btn-danger btn-uppercase" 
        onclick="event.preventDefault(); this.closest('form').submit();">
        <i class="wd-10 mg-r-5" data-feather="trash"></i>
        Delete All
    </a>
</form>
Viewed: 48 times
Liked: 1 times