• 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 loop through json response data using ajax jquery?

How to prevent phpmailer sending embedded image as an attachment on Gmail?

(Cache::lock()) -> get() -- Under what conditions does it return false?

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 [closed]

Magento 2 - Controller returning blank page

Natural ORDER in Laravel Eloquent ORM

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

PHP contact form configuration [duplicate]

Apply filter array/return terms

correct PHP headers for pdf file download

Clients authentication and user authentication with laravel

merging two arrays with specified index

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

how to remove white space in select 2

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

About Contact Privacy policy Terms and conditions