Skip to content
Snippets Groups Projects
Commit 89f0c9b5 authored by SASSU Thomas's avatar SASSU Thomas
Browse files

Partie 6 platforms

parent 6fdf01af
No related branches found
No related tags found
No related merge requests found
......@@ -37,4 +37,12 @@ $app->get('/api/games/:id/comments',function ($id) {
$c = new ControleurGame();
$c->getGameComments($id);
});
$app->get('/api/games/:id/characters',function ($id) {
$c = new ControleurGame();
$c->getGameCharacters($id);
});
$app->get('/api/games/:id/platforms',function ($id) {
$c = new ControleurGame();
$c->getGamePlatforms($id);
});
$app->run();
\ No newline at end of file
......@@ -42,4 +42,11 @@ class ControleurGame
$v = new VueGame(json_encode($comments));
$v->render('getComments');
}
public function getGamePlatforms($id){
$game = Game::where('id', '=', $id)->first();
$platforms = $game->platforms()->get();
$v = new VueGame(json_encode($platforms));
$v->render('getPlatforms');
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment