• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How can I get new CSRF token in LARAVEL by using ajax

phpjqueryajaxlaravel-5


PHP Snippet 1:

<script type="text/javascript">
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                }
            });
</script>

PHP Snippet 2:

<meta name="_token" content="{!! csrf_token() !!}" />

Related Snippets

Generate random username based on full name php

Sum column values from multiple arrays

Merge key and value of array index [duplicate]

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

How to get monthly wise data in laravel

How to add class name to an existing tag in php

ldap is missing from system when installing adldap2 in laravel

Image upload not working through ajax Laravel

laravel 5.6 bulk inserting json data

Laravel Command Schedule Not Working Properly

Get latest Tweets - What API

How to break out of a foreach once a condition is met?

Create a zip file and download it

PHP-Sort array based on another array?

Send same name multiple checkbox values via ajax

About Contact Privacy policy Terms and conditions