Support the ongoing development of Laravel.io →
Security Requests Testing
Last updated 7 months ago.
0

venkyvegas said:

how to create PUT and DELETE method CSRF POC. of simple html post method

you can find it in here : https://laravel.com/docs/5.1/routing#csrf-protection my friend, here is what it says :

put the line below in your form

<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">

and put this line below at the head of your html

<meta name="csrf-token" content="{{ csrf_token() }}">

and then you can submit your form via ajax by doing this :

$.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
});

as your ajax setup

0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.