zachmay / inventory616

Inventory Management Project - CS 616
1 stars 0 forks source link

get and post method is not working in route file #16

Closed akm-sabbir closed 9 years ago

akm-sabbir commented 9 years ago

Hi Zack how r u ? i am having a problem in the virtual machine php server. i can not bypass the login authentication page. none of my Post and Get method is getting served although the route file is properly defined except for the login page.

akm-sabbir commented 9 years ago

route.php

<?php

/* -------------------------------------------------------------------------- Application Routes
Here is where you can register all of the routes for an application.
It's a breeze. Simply tell Laravel the URIs it should respond to
and give it the controller to call when that URI is requested.

*/

Route::get('/', 'HomeController@index');

Route::group([ 'prefix' => 'api', 'namespace' => 'Api', 'middleware' => 'auth.api' ], function () { Route::get('example', 'ExampleController@get'); Route::post('example', 'ExampleController@post'); //route for team6 Route::get('/inventory/{tag}/history','CheckInController@getHistory'); Route::get('/inventory/{tag}/history/latest','CheckInController@getHistoryLatest'); Route::get('/inventory/{tag}/history/{num}','CheckInController@getHistoryByNum'); Route::post('/inventory/{tag}/history','CheckInController@postHistory');

}); Route::controllers([ 'auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController', ]);

zachmay commented 9 years ago

Is there a branch I can use to try out the code?

akm-sabbir commented 9 years ago

team6api i guess

On Sun, Apr 5, 2015 at 7:28 PM, Zachary May notifications@github.com wrote:

Is there a branch I can use to try out the code?

— Reply to this email directly or view it on GitHub https://github.com/zachmay/inventory616/issues/16#issuecomment-89869011.

zachmay commented 9 years ago

@akm-sabbir What routes are giving your problems? What is the error message you're getting?

akm-sabbir commented 9 years ago

Route::group([ 'prefix' => 'api', 'namespace' => 'Api', 'middleware' => 'auth.api' ], function () { //route for team6 Route::get('inventory/{tag}/history','CheckInController@getHistory'); Route::get('/inventory/{tag}/history/latest','CheckInController@getHistoryLatest'); Route::get('/inventory/{tag}/history/{num}','CheckInController@getHistoryByNum'); Route::post('/inventory/{tag}/history','CheckInController@postHistory');

}); when i tried with 192.168.33.99/inventory/abc123/history the following error message showed up: Sorry, the page you are looking for could not be found. 1/1 NotFoundHttpException in RouteCollection.php line 145: my database contain the following data | 1 | ABC123 | MacBook Pro | Grant 1234A | 1 | MacBook Pro 2015 | 2.2 GHz Quad-core | 16GB | 512GB | Mac OS X 10.10 | 1| 0 | 0 | 0 | 2015-04-05 18:43:18 | 2015-04-05 18:43:18 | | 2 | abc1234 | MacBook Pro | Grant 1234A | 1 | MacBook Pro 2015 | 2.2 GHz Quad-core | 16GB | 512GB | Mac OS X 10.10 | 1| 0 | 0 | 0 | 2015-04-05 18:43:18 | 2015-04-05 18:43:18 | | 3 | XYZ789 | Projector | Grant 1234B | 3 | ViewSonic PJD5132 | | | | | 0| 1 | 0 | 0 | 2015-04-05 18:43:18 | 2015-04-05 18:43:18 |

in online i found a solution about reinstalling everything. i may try to reinstall everything thanks

zachmay commented 9 years ago

You're accessing /inventory/abc123/history, but the API endpoints all start with api/.

The call to Route::group(...) creates a group of routes that share common details for organizational purposes. In this case, we define a set of routes that all share the common URL prefix api/ (among other details).

akm-sabbir commented 9 years ago

got that. thannks and BR Sabbir

On Mon, Apr 6, 2015 at 3:44 PM, Zachary May notifications@github.com wrote:

Closed #16 https://github.com/zachmay/inventory616/issues/16.

— Reply to this email directly or view it on GitHub https://github.com/zachmay/inventory616/issues/16#event-274472009.