lundi 11 juin 2018

Delete\Add Row with AJAX (Secure way)

i am new to Laravel and trying to find way to delete or add row with AJAX request.

Let's say i have PostController and i want to delete one of my post. So in the PostController there will be destroy function :

public function destroy($id)
{
    Posts::find($id)->delete();
}

Now, how i can send from a view AJAX Request to Controller and use this destroy method in secure way.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire