• 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

Update Order custom Field value with WooCommerce REST API

The "client_reference_id" argument is not passed

Add Class in html Dynamically in PHP

How to Create WooCommerce Subscription Product via. REST API?

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

PHP DOTENV unable to load env vars

Unable to Edit config.inc.php

retrieve data from database using session

php mysql + create a friend request system

How to get variable from JavaScript to PHP [duplicate]

how to redirect the user back to desired URL after login page in PHP?

Inserting Country Selection into MySQL PHP [duplicate]

PHP: Print caught exception like Xdebug

Combine multiple columns into an array as one of the key in a results set

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

About Contact Privacy policy Terms and conditions