Signup for events implemented

This commit is contained in:
2026-03-22 00:06:03 +01:00
parent b8341890d3
commit 405591d6dd
13 changed files with 428 additions and 24 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Providers;
use App\Models\Event;
use DateTime;
class DoubleCheckEventRegistrationProvider {
function __construct(
private Event $event,
private string $firstname,
private string $lastname,
private string $email,
private DateTime $birthday,
) {}
public function isRegistered() : bool
{
$checkconditions = array(
'firstname' => $this->firstname,
'lastname' => $this->lastname,
'email_1' => $this->email,
'birthday' => $this->birthday->format('Y-m-d'),
);
return $this->event->participants()->where($checkconditions)->exists();
}
}