I am trying to build an angular + laravel rest application. I can get the views of my database. When I try to add new items. I get 500 error
telling me mismatch
An option will be to inject the CSRF token as a constant. Append the following in your head tag:
Then in your module methods it can be injected when needed.
app.factory("FooService", function($http, CSRF_TOKEN) {
console.log(CSRF_TOKEN);
};
Maybe you will be interested of peeking at the source code of this sample Laravel + AngularJS project.