2026-08-14 18:19:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Front;
|
|
|
|
|
|
2026-08-31 12:05:37 +02:00
|
|
|
use App\Events\JoinGroupRequested;
|
|
|
|
|
use App\Http\Requests\JoinGroupRequest;
|
2026-08-14 18:19:25 +02:00
|
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
|
use Inertia\Inertia;
|
|
|
|
|
use Inertia\Response;
|
|
|
|
|
use Uwil\LaravelCommon\Controllers\CommonController;
|
|
|
|
|
|
|
|
|
|
class JoinGroupController extends CommonController
|
|
|
|
|
{
|
|
|
|
|
public function index(): Response
|
|
|
|
|
{
|
|
|
|
|
return Inertia::render('front/Pages/JoinTheGroup', [
|
|
|
|
|
'communities' => [
|
|
|
|
|
['label' => 'La Communauté Amont', 'value' => 'amont'],
|
|
|
|
|
['label' => 'La Communauté Aval', 'value' => 'aval'],
|
|
|
|
|
['label' => 'La Communauté Transformateurs', 'value' => 'transformateurs'],
|
|
|
|
|
['label' => 'La Communauté Scientifique', 'value' => 'scientifique'],
|
|
|
|
|
['label' => 'La Communauté Autres Parties Prenantes', 'value' => 'autres'],
|
|
|
|
|
],
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-31 12:05:37 +02:00
|
|
|
public function store(JoinGroupRequest $request): RedirectResponse
|
2026-08-14 18:19:25 +02:00
|
|
|
{
|
2026-08-31 12:40:30 +02:00
|
|
|
|
|
|
|
|
JoinGroupRequested::dispatch($request->validated());
|
2026-08-31 15:35:09 +02:00
|
|
|
$request->hitEmailRateLimit();
|
2026-08-14 18:19:25 +02:00
|
|
|
|
|
|
|
|
return back()->with('success', true);
|
|
|
|
|
}
|
2026-08-20 16:39:37 +02:00
|
|
|
}
|