Пример #1
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::user()->summoner_id == 0) {
         return view('auth.connect');
     }
     $data['captain'] = false;
     $data['summoner'] = Summoners::findOrFail(Auth::User()->summoner_id);
     if (Auth::User()->team_id) {
         $data['team'] = teams::findOrFail(Auth::User()->team_id);
         if ($data['team']->captain_id == Auth::User()->id) {
             $data['captain'] = true;
         }
     }
     $data['users'] = User::all();
     $data['alerts'] = user_alert::all();
     return view('home', $data);
 }
Пример #2
0
                    <li>
                        <a href="#"></a>
                    </li>

                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#" style="padding-top: 8px;">
                            <button class="btn btn-default notifications" type="button">
                              Messages <span class="badge">{{ $count }}</span>
                            </button>
                        </a>
                        @if ($count != 0)
                            <ul class="dropdown-menu">
                                @foreach ($alerts as $alert)
                                    @if ($alert->user_id == Auth::User()->id)
                                        <?php 
$teaminfo = teams::findOrFail($alert->team_id);
?>
                                        <li class="notification">
                                            <a href="#" class="innernot">
                                            <span class="glyphicon glyphicon-exclamation-sign"></span>
                                             You've been invited to a team "{{ $teaminfo->name }}"
                                            </a>
                                            <div class="btn-group" role="group" aria-label="invite">
                                              <a type="button" class="btn btn-default" href="{{ url('team/addmember/' . $alert->user_id . '/' . $alert->team_id) }}">Accept</a>
                                              <a type="button" class="btn btn-default" href="#teams">View team</a>
                                              <a type="button" class="btn btn-default">Decline</a>
                                            </div>
                                        </li>
                                        <li class="divider"></li>
                                    @endif
                                @endforeach