Page Stubs and Click-Through Flow

This commit is contained in:
2026-02-03 10:14:00 +01:00
parent 3684d9ef6b
commit e8be239c32
27 changed files with 595 additions and 31 deletions

View File

@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers;
use App\Models\Category;
use App\Models\Screening;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
final class ScreeningController extends Controller
{
/**
* Create a new screening session for the authenticated user.
*/
public function store(Request $request): RedirectResponse
{
$screening = Screening::create([
'user_id' => auth()->id(),
]);
return redirect()->route('screening.show', $screening);
}
/**
* Display the screening questionnaire.
*/
public function show(Screening $screening): Response
{
return Inertia::render('Screening/Show', [
'screening' => $screening,
]);
}
/**
* Save screening answers and redirect to result.
*/
public function update(Request $request, Screening $screening): RedirectResponse
{
return redirect()->route('screening.result', $screening);
}
/**
* Display the screening result with available categories.
*/
public function result(Screening $screening): Response
{
return Inertia::render('Screening/Result', [
'screening' => $screening,
'categories' => Category::orderBy('sort_order')->get(['id', 'name']),
]);
}
}