Skip to content

Instantly share code, notes, and snippets.

View roNn23's full-sized avatar

Ronny Neefe roNn23

View GitHub Profile
@roNn23
roNn23 / laravel.js
Last active July 16, 2019 11:41 — forked from JeffreyWay/laravel.js
Updated delete-script of Jeffrey Way to work with Laravel 5. And optimized the implementation for the CSRF token. #laravel
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
Add this to your view:
<script>
window.csrfToken = '<?php echo csrf_token(); ?>';