ldc-bien-etre-animal/app/Http/Controllers/Front/QuestionsResponsesController.php

27 lines
751 B
PHP
Raw Normal View History

2026-08-14 18:19:25 +02:00
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Front;
use Inertia\Inertia;
use Inertia\Response;
use Uwil\LaravelCommon\Controllers\CommonController;
class QuestionsResponsesController extends CommonController
{
public function index(): Response
{
$translations = \trans('questions_responses_page');
2026-08-20 17:09:10 +02:00
/** @var array<string, string> $themes */
$themes = $translations['themes'];
2026-08-14 18:19:25 +02:00
return Inertia::render('front/Pages/QuestionsResponses', [
2026-08-20 17:09:10 +02:00
'themes' => collect($themes)
2026-08-14 18:19:25 +02:00
->map(fn ($label, $value) => ['label' => $label, 'value' => $value])
->values()
->all(),
'questions' => $translations['questions'],
]);
2026-08-14 18:19:25 +02:00
}
}