• 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

Prestashop webservice API creating cart rules

Custom API and cunsuming in php?

Form Validation and Submission to database

Add a custom text for a particular product on specific email notification in Woocommerce

Sort a multidimensional array by integer inside of a string value which is two levels down

How do I set the maximum php memory limit

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

how to remove white space in select 2

How to fix bootstrap multiselect search data using ajax

Display a product custom field only in WooCommerce Admin single orders

How to Generate PDF invoice to XML format using mPDF

PHP Deprecated issue when running artisan command

php echo xml documents with header

Sum array values of a column within each column of an array with 3 levels

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

About Contact Privacy policy Terms and conditions