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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community