jeudi 24 mai 2018

Laravel Resource controller not getting delete route on amchor click

In laravel i have resource controller :

Route::resource('/student','StudentController');

here is my view listing code :

<tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>
        <a href="#">Edit</a> |
        <a href="">Link</a>

    </td>
</tr>

conytroller function i have :

public function destroy($id)
    {
       echo "ok";
    }

My problem is that when i click on anchor button(delete ) it not found the resource route for the delete what i am doing wrong here can anyone please help me elated this. when i click on the delete anchor it call the show function of resource but i want the destroy function to call on click.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire