mardi 31 mai 2016

TokenMismatchException in VerifyCsrfToken.php line 67 using Route::post()

I understand that this is a common issue with Laravel, but my particular run-in with the problem is not through submitting a form. Instead, I am using postman to send data to a URL endpoint to test if data is successfully received.

Here is my routes.php file (related content)

Route::group(['middleware' => 'auth'], function () {
    Route::post('/cart', 'CartController@buildcart');
});

Here is my CartController.php (entire file)

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;

class CartController extends Controller
{
    public function buildcart(){
        echo 'hello';
    }
}

As simple as that is, when I use postman to send random data to the /cart URL, I get

TokenMismatchException in VerifyCsrfToken.php line 67:

Can anyone help me understand why this is failing? I don't see how using



is the solution for this case since the data is coming from an external source.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Xees7i
via IFTTT

Aucun commentaire:

Enregistrer un commentaire