Files
ladill-events/app/Models/QrEventRegistration.php
T
isaaccladandCursor d8dbc83e2d
Deploy Ladill QR Plus / deploy (push) Successful in 28s
Extract Ladill Events as a standalone events suite at events.ladill.com.
Full control center for ticketed events, contributions, attendees, badges,
and programmes — not a QR utility clone. Includes SSO shell, import command,
and platform cutover runbook.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:39:53 +00:00

62 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class QrEventRegistration extends Model
{
public const STATUS_PENDING = 'pending';
public const STATUS_CONFIRMED = 'confirmed';
public const STATUS_FAILED = 'failed';
public const STATUS_CANCELLED = 'cancelled';
protected $fillable = [
'qr_code_id',
'user_id',
'reference',
'badge_code',
'tier_name',
'amount_minor',
'currency',
'attendee_name',
'attendee_email',
'attendee_phone',
'badge_fields',
'status',
'payment_reference',
'paid_at',
'checked_in_at',
'metadata',
];
protected $casts = [
'badge_fields' => 'array',
'metadata' => 'array',
'amount_minor' => 'integer',
'paid_at' => 'datetime',
'checked_in_at' => 'datetime',
];
public function qrCode(): BelongsTo
{
return $this->belongsTo(QrCode::class);
}
public function organizer(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
public function amountCedis(): float
{
return round($this->amount_minor / 100, 2);
}
public function isPaid(): bool
{
return $this->amount_minor > 0;
}
}