Dashboard history
This commit is contained in:
@@ -12,6 +12,17 @@ use DB;
|
||||
class ShitController extends Controller
|
||||
{
|
||||
|
||||
public function dashboard() {
|
||||
|
||||
$allshits = ShitUser::all()->sortByDesc('created_at')->take(100);
|
||||
$buttonRand = collect(['Plop!', 'Pflomp!', 'Zwusch!', 'Blomp!'])->random();
|
||||
return view('dashboard')->with([
|
||||
'allshits' => $allshits,
|
||||
'buttonRand' => $buttonRand,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function increment(Request $request) {
|
||||
$shituser = new ShitUser();
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
@csrf
|
||||
<div class="col-sm-6">
|
||||
<label for="description" class="form-label">Beschreibung</label>
|
||||
<input type="text" class="form-control" id="description" placeholder="Beschreibungstext hier einfügen..." value="">
|
||||
<input type="text" class="form-control" id="description" name="description" placeholder="Beschreibungstext hier einfügen..." value="">
|
||||
<div class="invalid-feedback">
|
||||
Ungültige Beschreibung.
|
||||
</div>
|
||||
@@ -23,10 +23,30 @@
|
||||
<input type="checkbox" class="form-check-input" id="goldenshit" name="goldenshit">
|
||||
<label class="form-check-label" for="goldenshit">Mein Stuhlgang war ein goldener Schiss.</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-lg">Plop!</button>
|
||||
<button type="submit" class="btn btn-primary btn-lg">{{ $buttonRand }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Zeit</th>
|
||||
<th scope="col">Beschreibung</th>
|
||||
<th scope="col">Goldener Schiss</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($allshits as $shit)
|
||||
<tr>
|
||||
<th scope="row">{{ $shit->created_at }}</th>
|
||||
<td>{{ $shit->description }} </td>
|
||||
<td>{{ $shit->goldenshit ? "Ja" : "Nein" }} </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</x-app-layout>
|
||||
|
@@ -19,9 +19,7 @@ Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});
|
||||
|
||||
Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
})->middleware(['auth'])->name('dashboard');
|
||||
Route::get('/dashboard', [ShitController::class, 'dashboard'])->middleware(['auth'])->name('dashboard');
|
||||
|
||||
Route::post('/increment', [ShitController::class, 'increment'])->middleware(['auth']);
|
||||
Route::get('/ownstats', [ShitController::class, 'ownStats'])->middleware(['auth']);
|
||||
|
Reference in New Issue
Block a user