I am building an application with angularjs and laravel 4. Everything is fine, but now I only need to allow XHR requests.
This is what I have at the beginning of my controller. But this statement is always incorrect.
if (!\Request::ajax()) { return Response::json(array('halt'=>Request::ajax())); };
In angular, I am using the standard $ http service.
angular.module('APP') .factory("API", ($http,$q,appClient,apiURL) -> class FB constructor:-> this.deferredData = $q.defer(); info: (reload)-> $http( method: "get" url: apiURL+'game/'+appClient+"/info" ).success((res)-> dostuff() )
angularjs ajax php coffeescript laravel-4
zajca Dec 09 '13 at 16:22 2013-12-09 16:22
source share