• 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

The sum of the user's points

retrieve data from database using session

WooCommerce - unset "<product> removed notice…" on cart page

Currently Using CodeIgniter Framework i have an Error

Get lat/lon from google maps url ftid (hex)

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

PHPExcel file download using AJAX call

PHP function Not Working As Expected From functions.php Include File

Wordpress how to get the post thumbnail inside a figure tag

Coinpayments create_transaction "ERROR: Invalid command!"

Remove categories with all childs derived from parent category

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

How to set dynamic `home` and `siteurl` in WordPress?

How to change product Image when variables are selected in Shop and Archive Pages?

laravel 5.6 bulk inserting json data

About Contact Privacy policy Terms and conditions