0cf9602958
Events can be moved to archive and moved back Fixed validation
28 lines
879 B
PHP
28 lines
879 B
PHP
<?php
|
|
|
|
namespace App\Domains\Event\Controllers;
|
|
|
|
use App\Providers\InertiaProvider;
|
|
use App\Scopes\CommonController;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Response;
|
|
|
|
class ArchivedEventsController extends CommonController
|
|
{
|
|
public function __invoke(Request $request): Response {
|
|
$events = [];
|
|
foreach ($this->events->getEventsByCriteria(['archived' => true]) as $event) {
|
|
$events[] = [
|
|
'id' => $event->id,
|
|
'name' => $event->name,
|
|
'location' => $event->location,
|
|
'postalCode' => $event->postal_code,
|
|
'eventBegin' => $event->start_date->format('d.m.Y'),
|
|
'eventEnd' => $event->end_date->format('d.m.Y'),
|
|
];
|
|
}
|
|
|
|
return (new InertiaProvider('Event/ArchivedEvents', ['events' => $events]))->render();
|
|
}
|
|
}
|