public function deleteCharacter($id) { $player = Player::findOrFail($id); $player->delete(); flash()->error('Postać o ID <b>' . $id . '</b> została usunięta!'); return redirect('/admin/character'); }
/** * Returns Round Players Statistics with Ajax request for Round Details Section * @param $id * @return $this */ public function getRoundPlayerWithAjax($id) { $player = Player::findOrFail($id); return view('partials._round-player-ajax')->with('player', $player); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // This method has 2 ways of deleting a record in the database $player = Player::findOrFail($id); // Call the delete method $player->delete(); // Or you can do it this way // Player::destroy($id); // redirect whereever you would like. Back to player index in this instance return redirect('players'); }