I want to create a dropdown with two links. A 'Delete' and a 'Edit' link.
For the delete function I created a form.
{!! Former::horizontal_open()->method('DELETE')->action(action("Test\\TestController@destroythread", $comment->id)) !!}
{!! Former::danger_submit('Delete') !!}
{!! Former::close() !!}
The form works, that means my comment get's deleted, if I'm pressing the button.
No I decided to remove the delete button and do a dropdown with a delete link. So I need to get the logic of this form in my dropdown menu.
But I haven't got this in the dropdown.. The optical 'Delete' button is this part of the dropdown:
<li><a href="#">
Delete
</a></li>
But I can't just put my controller function in that "href-link", cause without the 'DELETE'-Method, it won't work. I hope you all understand what I'm trying to say... my english isn't the best anyway.
Can somebody help me with this?
Thanks for any help!
I tried it like this before but this haven't worked either:
<li>
<a>
{!! Former::horizontal_open()->method('DELETE')->action(action("Test\\TestController@destroythread", $comment->id)) !!}
Delete
{!! Former::close() !!}
</a>
</li>
my try linking directly to the route:
<li><a href="{{ route('destroy', $comment->id) }}">Delete</a></li>
and my Route looks like this:
Route::delete('/show/{id}', 'Test\\TestController@destroythread')->name('destroythread');
but this haven't worked for me..
all /show/ routes:
Route::get('/show/{id}', 'Test\\TestController@show');
Route::put('/show/{id}/edit', ['as' => 'editing', 'uses' => 'Test\\TestController@update']);
Route::get('/show/{id}/edit', 'Test\\TestController@edit')->name('edit');
Route::delete('/show/{id}', 'Test\\TestController@destroy')->name('destroy');
Route::delete('/show/{id}', 'Test\\TestController@destroythread')->name('destroythread'); // this is the route we are talking about