• 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

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

PHP if in_array() how to get the key as well?

Laravel print last executed SQL query with Query log

How to identify whether webp image is static or animated?

using random function but it's displaying duplicates

Laravel update hasMany relationship using saveMany

How to send parameters in soap request in php in __soapcall() function

Whats the point of running Laravel with the command 'php artisan serve'?

How to fix Call to undefined method AppModelsTableName::factory?

Twig - How to check if variable is a number / integer

Display Link Title Instead of URL in XSL

How to load Codeigniter 4 lang file into an array variable

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Override default Auth routes in Laravel 7

IlluminateDatabaseQueryException could not find driver [duplicate]

About Contact Privacy policy Terms and conditions