| @@ 71-82 (lines=12) @@ | ||
| 68 | ); |
|
| 69 | }); |
|
| 70 | ||
| 71 | $api->get('/teams/{id}/players', function ($request, $response, $args) {
|
|
| 72 | return Responder::getJsonResponse( |
|
| 73 | Team::with( |
|
| 74 | 'roster' |
|
| 75 | )->where( |
|
| 76 | [ |
|
| 77 | 'id' => $args['id'] |
|
| 78 | ] |
|
| 79 | )->get(), |
|
| 80 | $response |
|
| 81 | ); |
|
| 82 | }); |
|
| 83 | ||
| 84 | $api->get('/teams/{id}/players/{playerId}', function ($request, $response, $args) {
|
|
| 85 | return Responder::getJsonResponse( |
|
| @@ 96-107 (lines=12) @@ | ||
| 93 | ); |
|
| 94 | }); |
|
| 95 | ||
| 96 | $api->get('/teams/{id}/coach', function ($request, $response, $args) {
|
|
| 97 | return Responder::getJsonResponse( |
|
| 98 | Team::with( |
|
| 99 | 'coach' |
|
| 100 | )->where( |
|
| 101 | [ |
|
| 102 | 'id' => $args['id'] |
|
| 103 | ] |
|
| 104 | )->get(), |
|
| 105 | $response |
|
| 106 | ); |
|
| 107 | }); |
|
| 108 | ||
| 109 | $api->get('/leagues', function ($request, $response, $args) {
|
|
| 110 | return Responder::getJsonResponse( |
|