Public Access
34 lines
859 B
PHP
34 lines
859 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Bewerbung;
|
|
use Illuminate\Http\Request;
|
|
|
|
class BewerbungAdminController extends Controller
|
|
{
|
|
// Übersicht aller Runden
|
|
public function index(Request $request)
|
|
{
|
|
$bewerbungen = Bewerbung::query()
|
|
->withCount('applications')
|
|
->orderByDesc('start_at')
|
|
->orderBy('name')
|
|
->paginate(20);
|
|
|
|
return view('admin.bewerbungen.index', compact('bewerbungen'));
|
|
}
|
|
|
|
// Detailseite einer Runde mit Bewerbungs-Tabelle
|
|
public function show(Bewerbung $bewerbung)
|
|
{
|
|
$applications = $bewerbung->applications()
|
|
->with('band')
|
|
->latest()
|
|
->paginate(25);
|
|
|
|
return view('admin.bewerbungen.show', compact('bewerbung','applications'));
|
|
}
|
|
}
|