I've got an tiny little problem. I've got a table in database called 'player_skills'. It contains columns like this (example):
player_id | skill_id | value | count
15 0 10 12
15 1 10 51
...
15 8 10 12
The player_id is actually an id of the player which is column 'id' under 'players' table.
Also there are eight skills. Value is the default value (which is irrelevant in this case). The count is the value (the value of the players skill).
Basically, what I want is to pull data into a Bootstrap tabs (example):
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
<li class="active"><a href="?skill0" data-toggle="tab">Section 1</a></li>
<li><a href="?skill1" data-toggle="tab">Section 2</a></li>
<li><a href="?skill2" data-toggle="tab">Section 3</a></li>
...
</ul>
<div class="tab-content">
<div class="tab-pane active" id="?skill0">
<p>I'm in Section A.</p>
</div>
<div class="tab-pane" id="?skill1">
<p>Howdy, I'm in Section B.</p>
</div>
<div class="tab-pane" id="?skill2">
<p>What up girl, this is Section C.</p>
</div>
</div>
</div>
I want to order it (from the highest to the lowest,( also I have an 'group_id' column in every player, so I don't want it to include a player which has an group_id equals to three) but for every skill). Also I have one skill that's located in the 'players' table (column called 'experience') and I've done it like this:
public function highscores()
{
$players = Player::orderBy('experience','desc')->get();
return View::make('aac.highscores')->with('players', $players);
}
It works just fine, but I need it in tabs to change for every skill.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…