Update highscores view, add prices
This commit is contained in:
@@ -46,7 +46,7 @@ class ShitController extends Controller
|
||||
|
||||
public function highscores() {
|
||||
|
||||
$allshits = ShitUser::groupBy('user_id')->select('user_id', DB::raw('count (*) as total'))->get();
|
||||
$allshits = ShitUser::groupBy('user_id')->select('user_id', DB::raw('count (*) as total'))->orderByDesc('total')->get();
|
||||
$users = User::all()->sortBy('name');
|
||||
|
||||
return view('highscores')->with([
|
||||
|
@@ -14,10 +14,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($users as $user)
|
||||
@foreach($allshits as $shit)
|
||||
<tr>
|
||||
<th scope="row">{{ $user->name }}</th>
|
||||
<td>{{ $allshits->where('user_id', $user->id)->first()->total }} </td>
|
||||
<th scope="row">{{ $users->where('id', $shit->user_id)->first()->name }}</th>
|
||||
<td>{{ $shit->total }} </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<li><a href="/dashboard" class="nav-link px-2 text-white">Dashboard</a></li>
|
||||
<li><a href="/ownstats" class="nav-link px-2 text-white">Eigene Statistik</a></li>
|
||||
<li><a href="/highscores" class="nav-link px-2 text-white">Highscores</a></li>
|
||||
<li><a href="/" class="nav-link px-2 text-white">Preise</a></li>
|
||||
<li><a href="/prices" class="nav-link px-2 text-white">Preise</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@@ -6,8 +6,7 @@
|
||||
</a>
|
||||
|
||||
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
|
||||
<li><a href="/" class="nav-link px-2 text-secondary">Shit-Show</a></li>
|
||||
<li><a href="/" class="nav-link px-2 text-white">Preise</a></li>
|
||||
<li><a href="/" class="nav-link px-2 text-white">Shit-Show</a></li>
|
||||
<li><a href="/faq" class="nav-link px-2 text-white">FAQ</a></li>
|
||||
<li><a href="/credits" class="nav-link px-2 text-white">Credits</a></li>
|
||||
</ul>
|
||||
|
17
shit-show/resources/views/prices.blade.php
Normal file
17
shit-show/resources/views/prices.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<x-app-layout>
|
||||
<!--<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
{{-- __('Dashboard') --}}
|
||||
</h2>
|
||||
</x-slot>-->
|
||||
|
||||
|
||||
<div class="p-5 mb-4 bg-light rounded-3">
|
||||
<div class="h-100 p-5 bg-light border rounded-3">
|
||||
<h2>Preise</h2>
|
||||
<p>Hier werden jeden Monat neue Challenges veröffentlicht. Der Gewinner erhält einen Preis.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</x-app-layout>
|
@@ -26,7 +26,9 @@ Route::get('/dashboard', function () {
|
||||
Route::post('/increment', [ShitController::class, 'increment'])->middleware(['auth']);
|
||||
Route::get('/ownstats', [ShitController::class, 'ownStats'])->middleware(['auth']);
|
||||
Route::get('/highscores', [ShitController::class, 'highscores'])->middleware(['auth']);
|
||||
|
||||
Route::get('/prices', function () {
|
||||
return view('prices');
|
||||
})->middleware(['auth']);
|
||||
|
||||
Route::get('/faq', function () {
|
||||
return view('faq');
|
||||
|
Reference in New Issue
Block a user