Example #1
0
 public function handleDelete()
 {
     // hand the delete confirmation
     $id = Input::get('id');
     $game = Game::findOrFail($id);
     $game->delete();
     return Redirect::action('GamesController@index');
 }
Example #2
0
 /**
  * Update the specified game in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $game = Game::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Game::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $game->update($data);
     return Redirect::route('games.index');
 }
 public function handleDelete()
 {
     if (Auth::guest()) {
         return Redirect::action('UserController@login');
     }
     // Handle the delete confirmation.
     $id = Input::get('game');
     $game = Game::findOrFail($id);
     $game->delete();
     return Redirect::action('GamesController@index');
 }
Example #4
0
 public function deleteScript($id, $scriptId)
 {
     /** @var Game $game */
     $game = Game::findOrFail($id);
     $game->scripts()->detach($scriptId);
     // return Redirect::action('GameController@getScript', $id);
 }