나는 경로가 routes.php 파일에 정의했지만 난 내 각 응용 프로그램에서 아약스 요청을 할 때, 나는이 오류를 얻을 수는정의 경로 던지는 컨트롤러 방법을 찾을 수 없습니다 laravel 4
{"error":{"type":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","message":"Controller method not found.","file":"C:\\xampp\\htdocs\\tedxph\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controllers\\Controller.php","line":290}}
이 내 경로 파일입니다
/*
|--------------------------------------------------------------------------
| Api Routes
|--------------------------------------------------------------------------
*/
Route::group(array('prefix' => 'api'), function() {
//Auth Routes
Route::post('auth/login', '[email protected]');
Route::post('auth/signup', '[email protected]');
/* Persons */
Route::group(array('prefix' => 'people'), function() {
Route::get('{id}', '[email protected]');
Route::get('/', '[email protected]');
});
/* Events */
Route::group(array('prefix' => 'events'), function() {
Route::get('{id}', '[email protected]');
Route::get('/','[email protected]');
});
});
오류를 제공하지 않습니다 크롬에 나머지 클라이언트 응용 프로그램에서 동일한 URL (http://localhost/site/public/api/auth/signup)
액세스, 무슨 일을 할 수 있을까?
이 내 컨트롤러에서 각 코드는
$rootScope.show('Please wait..registering');
API.register({email: email, password: password})
.success(function (data) {
if(data.status == "success") {
console.log(data);
$rootScope.hide();
}
})
.error(function (error) {
console.log(error)
$rootScope.hide();
})
더 각도 코드
angular.module('tedxph.API', [])
.factory('API', function ($rootScope, $http, $ionicLoading, $window) {
//base url
var base = "http://localhost/tedxph/public/api";
return {
auth: function (form) {
return $http.post(base+"/auth/login", form);
},
register: function (form) {
return $http.post(base+"/auth/signup", form);
},
fetchPeople: function() {
return $http.get(base+"/people");
},
fetchEvents: function() {
return $http.get(base+"/events");
},
}
});
POST 또는 GET을 시도합니까? POST 요청으로 설정했기 때문입니다. – Lynx
그것의 게시물 요청은 API.register() 메소드에서 $ http.post를 사용하고 있습니다 – MrFoh