• 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

Multiple order by in WooCommerce

How do I get friend list from Friends table with counts of friends of my friends

How to modify CSS in a specific page of the WP admin dashboard (backend)

How to create a video stream from a single dynamic image in PHP

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

301 Redirect to remove query string on homepage only

Populate Dynamic Dropdowns List in Codeigniter

how do i retrieve and display the alt text of an image in wordpress?

add uri parameter to Route name in laravel

Calculating Median of an array in PHP

PHP my timezone is no setting up in PHP.ini File in xampp

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

wordpress function breaks wp-admin

How to install LDAP in Docker php-fpm alpine

About Contact Privacy policy Terms and conditions