I am working in laravel 5.7 along with angularjs. I receive the data but sometimes it gives me data and sometime it gives me an error which is data is not valid json form, parse {} error. Below is my angularjs code
$http({
method: "GET",
url : "get-portlanding" //Laravel route
}).then(function(response){
$scope.portlanding= response.data;
});
Below is laravel controller code.
public function GetPortLanding(){
$result = Portlanding::all();
return response->json($result);
}
Below is error picture What am i doing wrong can anyone help me out of this headache. Thanks