feat: Lernapp mit Mathe/Deutsch/Englisch, Münzsystem und Belohnungen

This commit is contained in:
root
2026-05-05 14:41:09 +00:00
parent 21e40cd2da
commit bd1640994c
45 changed files with 1522 additions and 58 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Models\QuestionAttempt;
use App\Models\RewardRedemption;
class DashboardController extends Controller {
public function index() {
$children = User::where('role','child')->count();
$questions = \App\Models\Question::count();
$attempts_today = QuestionAttempt::whereDate('created_at', today())->count();
$pending = RewardRedemption::where('status','pending')->count();
$topKids = User::where('role','child')->orderByDesc('points')->take(5)->get();
$recentAttempts = QuestionAttempt::with(['user','question.subject'])
->latest('id')->take(10)->get();
return view('admin.dashboard', compact(
'children','questions','attempts_today','pending','topKids','recentAttempts'
));
}
}