<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
@include ('layouts.navbar')

<h1>Showing {{ $nerd->name }}</h1>

<div class="jumbotron text-center">
        <h2>{{ $nerd->name }}</h2>
        <p>
            <strong>Email:</strong> {{ $nerd->email }}<br>
            <strong>Level:</strong> {{ $nerd->nerd_level }}<br><br>
            <strong><u>Groups:</u></strong><br>
                <?php 
$groups = Nerd::find($nerd->id)->groups;
?>

                @foreach($groups as $k => $v)
                    <span class="glyphicon glyphicon-star" style="color:orange"></span>
                    {{ $v->group_name }}
                    </br>
                   
                @endforeach
            
        </p>
    </div>

</div>
</body>
</html>
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     // delete
     $nerd = Nerd::find($id);
     $nerd->delete();
     // redirect
     Session::flash('message', 'Successfully deleted the nerd!');
     return Redirect::to('nerds');
 }
        break;
    case "1":
        echo "Sees Sunlight";
        break;
    case "2":
        echo "Foosball Fanatic";
        break;
    case "3":
        echo "Basement Dweller";
}
?>
            </td>

            <td>
                <?php 
$groups = Nerd::find($value->id)->groups;
//print_r($groups);
?>

                @foreach($groups as $k => $v)
                    <span class="glyphicon glyphicon-star" style="color:orange"></span>
                    {{ $v->group_name }}
                    </br>
                   
                @endforeach
            </td>

             <!-- we will also add show, edit, and delete buttons -->
            <td>
                
                <!-- delete the nerd (uses the destroy method DESTROY /nerds/{id} -->