Answers for "laravel jquery ajax post csrf with form validation"

PHP
0

laravel jquery ajax post csrf

data: {
        "_token": "{{ csrf_token() }}",
        "id": id
        }
Posted by: Guest on October-13-2021
1

laravel jquery ajax post csrf

<script>
 $(document).ready(function() {
    $(document).on('click', '#ajax', function () {
      $.ajax({
         type:'POST',
         url:'/ajax',
         headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
         success:function(data){
            $("#msg").html(data.msg);
         }
      });
    });
});
</script>
Posted by: Guest on March-25-2022

Browse Popular Code Answers by Language