• 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

How to map the two arrays with a duplicate value?

Laravel 5.2: Unable to locate factory with name [default]

How can I make a full text index of the column?

Malformed MIME header error in Symfony 5.3

Pages are working fine on localhost but not running on the hosting server

How to increase the PHP upload limits [duplicate]

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

How to identify whether webp image is static or animated?

Edit product hook WooCommerce

how to loop through json response data using ajax jquery?

PHP Download MP3 files from directory on server

PHP array, move keys and values to new array, but mix it up

curl returning 301 error after migrating to https

Access denied for user 'homestead'@'localhost' (using password: YES)

Detect emoticons in string

About Contact Privacy policy Terms and conditions