public function delete($id) { $list = TeamDetail::where('team_id', $id)->get(); foreach ($list as $key => $value) { $value->delete(); } Leader::find($id)->delete(); return redirect()->route('admin.index')->with('success', 'successfully deleted'); }
public function leaders() { $leaders = Leader::score(20); $i = 1; return view('leaderboard', compact('leaders', 'i')); }