Search code examples
laravelshowdestroy

Laravel link to action destroy not working


I am not sure why but this is acting as a show method. Please help.

{{ link_to_action('QuestionsController@destroy', 'Delete', $question->id) }}    

// In my QuestionsController
public function destroy($question_id)
{
    return 'hello';
}

Since I'm linking to the delete method directly, I don't have to use a form with a route with a delete method. Is this right?


Solution

  • Because you need post form with pseudo delete http method like in the docs: laravel.com/docs/4.2/html#opening-a-form. Unless you're not using default laravel routes of course. – Jarek Tkaczyk

    This was the solution, thank you!