-
Notifications
You must be signed in to change notification settings - Fork 0
Routing
Marco E edited this page Aug 28, 2020
·
1 revision
- Add the routing to the
api.phpfile in theroutesfolder:
Route::group(['prefix' => 'v1'], function () {
Route::apiResource('meeting', 'API\MeetingController');
Route::resource('meeting/registration', 'API\RegistrationController')->only([
'store', 'destroy'
]);
Route::post('user', [
'uses' => 'API\AuthController@store'
]);
Route::post('user/signin', [
'uses' => 'API\AuthController@signin'
]);
});- Test the routes directly on browser or download postman, you should always get the string
It works!as a response in every case:
| HTTP Method | URL | Controller Action |
|---|---|---|
| GET | http://homestead.test/api/v1/meeting | API\MeetingController@index |
| GET | http://homestead.test/api/v1/meeting/1 | API\MeetingController@show |
| POST | http://homestead.test/api/v1/meeting | API\MeetingController@store |
| PATCH | http://homestead.test/api/v1/meeting/1 | API\MeetingController@update |
| DELETE | http://homestead.test/api/v1/meeting/1 | API\MeetingController@destroy |
| DELETE | http://homestead.test/api/v1/meeting/registration/1 | API\RegistrationController@destroy |
| POST | http://homestead.test/api/v1/meeting/registration | API\RegistrationController@store |
| POST | http://homestead.test/api/v1/user | API\AuthController@store |
| POST | http://homestead.test/api/v1/user/signin | API\AuthController@signin |
meeting-API - 2020