Files
mareike/app/Domains/Event/Controllers/EventUnarchiveController.php
T
th.guenther 0cf9602958 Direct payments for invoices
Events can be moved to archive and moved back
Fixed validation
2026-05-12 16:04:15 +02:00

23 lines
754 B
PHP

<?php
namespace App\Domains\Event\Controllers;
use App\Domains\Event\Actions\UnarchiveEvent\UnarchiveEventCommand;
use App\Domains\Event\Actions\UnarchiveEvent\UnarchiveEventRequest;
use App\Scopes\CommonController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class EventUnarchiveController extends CommonController
{
public function __invoke(int $eventId, Request $request): JsonResponse {
$event = $this->events->getById($eventId);
$unarchiveRequest = new UnarchiveEventRequest($event);
$unarchiveCommand = new UnarchiveEventCommand($unarchiveRequest);
$response = $unarchiveCommand->execute();
return response()->json(['status' => $response->success ? 'success' : 'error']);
}
}