Exemple #1
0
 public function postEdit($id)
 {
     $game = new Game();
     $game->id = $id;
     $game->name = Request::input('name');
     $game->year = Request::input('year');
     $game->save();
     return redirect('games');
 }
 /**
  * Grab the list of games from the db and load the products view content.
  *
  * @return view
  */
 public function index()
 {
     //Submit the array of Game objects to the view as $gameList variable.
     return view('products', ['gameList' => Game::all()]);
 }
 public function single($gameTitle)
 {
     $game = Game::find($gameTitle);
     return view('SingleProduct')->with(array('game' => $game));
 }
 public function persoJeu12342()
 {
     foreach (Game::find(12342)->characters() as $ch) {
         echo $ch->id . '. ' . $ch->name . ' : ' . $ch->deck . "\n";
     }
 }