chore: complete update
This commit is contained in:
47
src/Application/Contact/ShowContact.php
Normal file
47
src/Application/Contact/ShowContact.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Application\Contact;
|
||||
|
||||
use App\Framework\Attributes\Route;
|
||||
use App\Framework\CommandBus\CommandBus;
|
||||
use App\Framework\Http\Method;
|
||||
use App\Framework\Meta\Keywords;
|
||||
use App\Framework\Meta\StaticPageMetaResolver;
|
||||
use App\Framework\Router\ActionResult;
|
||||
use App\Framework\Router\Result\ContentNegotiationResult;
|
||||
use App\Framework\Router\Result\ViewResult;
|
||||
|
||||
final readonly class ShowContact
|
||||
{
|
||||
#[Route(path: '/kontakt', name: 'contact')]
|
||||
public function __invoke(): ViewResult
|
||||
{
|
||||
return new ViewResult('contact',
|
||||
new StaticPageMetaResolver(
|
||||
'Kontakt',
|
||||
'Kontaktseite!',
|
||||
Keywords::fromStrings('Kontakt', 'Welt')
|
||||
)(),);
|
||||
}
|
||||
|
||||
#[Route(path: '/kontakt', method: Method::POST)]
|
||||
public function senden(ContactRequest $request, CommandBus $commandBus): ActionResult
|
||||
{
|
||||
|
||||
$command = new StoreContact(
|
||||
$request->email,
|
||||
$request->name,
|
||||
$request->subject ?? 'Kein Betreff angegeben',
|
||||
$request->message,
|
||||
);
|
||||
|
||||
$commandBus->dispatch($command);
|
||||
|
||||
dd($request);
|
||||
|
||||
return new ContentNegotiationResult(
|
||||
|
||||
);
|
||||
#return new ViewResult('contact-senden');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user