• 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

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

how to loop through json response data using ajax jquery?

How to get monthly wise data in laravel

How to make dot match newline characters using regular expressions

WooCommerce Additional Information - if empty, hide

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

PHP Discord OAUTH2 code sample not working

PHP mail sending empty mails

Put content of wordpress page inside div

how to create html table in php

Artisan, creating tables in database

Mobile browsers are adding .html to filename on download

Implode array with array of glue strings

How to change HTML structure inside WP <head>

Access relation of pivot table in Laravel

About Contact Privacy policy Terms and conditions