• 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 override htaccees file for cache control header

Undefined variable in Laravel 8 project (php 7.4)

calling server using nusoap with complextype

Mobile browsers are adding .html to filename on download

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

Mysqli multi query error

I can't delete my image when it is liked because of the foreign key in mysql

How to create a individual template for page or post in custom plugin?

I want to store data in new index as per my key in php [duplicate]

Getting public posts of a random user from Facebook API

Can we define variables in `.tpl` files?

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

Jquery DataTables: Data not displaying in table via Ajax

Laravel 5.5 change unauthenticated login redirect url

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

About Contact Privacy policy Terms and conditions