• 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

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

Clear javascript source cache laravel 5.8

Sum array values

How to find phpcs current default standard

Execute only one time and then wait set period of time before executing again

How to get multiple values with same key from an array PHP

Calculating Median of an array in PHP

PHP mail sending empty mails

How to install ZeroMQ for PHP on an Alpine Linux container?

Getting values for an enum?

WHM Enabling mod_rewrite

javascript html popup window

Laravel Nova, route not found

PHP - Store information with NO database

How to increase the PHP upload limits [duplicate]

About Contact Privacy policy Terms and conditions