37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Front;
|
|
|
|
use App\Events\JoinGroupRequested;
|
|
use App\Http\Requests\JoinGroupRequest;
|
|
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'],
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function store(JoinGroupRequest $request): RedirectResponse
|
|
{
|
|
|
|
JoinGroupRequested::dispatch($request->validated());
|
|
|
|
|
|
return back()->with('success', true);
|
|
}
|
|
}
|