• 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

Symfony - "framework.test" config is not set to true

Redis Command To Sort Keys

find in set in laravel ? example

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

how to check version of codeigniter framework?

Nginx disallowing execution of PHP in uploads directory with Magento

Laravel eloquent update record without loading from database

Symfony/Form add attribute based on the data

How to change the app environment at run time?

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

Laravel insert dynamic input values with radio button

Laravel print last executed SQL query with Query log

Getting public posts of a random user from Facebook API

Navigation idle on content download

About Contact Privacy policy Terms and conditions