HeartOfprogrammer HeartOfprogrammer - 6 months ago 45
PHP Question

How to convert HTML FORM to simple html code in laravel?

I need to convert this HTML FORM

{!! Form::open(['route' => ['news.destroy', $news->id], 'method' => 'delete']) !!}
<input type="submit" value="Delete" />
{!! Form::close() !!}
<div class="pull-right"><em>{{'Author - ' . $news->author }}</em></div>


To a simple HTML form

I have tried this, but it didn't work

<form action="{{ route('news.destroy', $news->id, ['method' => 'delete']) }}">
<input type="submit" value="delete" />
</form>

Answer

Use this

 <form method="post" action="{{ route('news.destroy', $news->id)}}" accept-     charset="UTF-8">
     <input type="submit" value="Delete" />
 </form>