implemented event package addons with filament resource, event-admin purchase path and notifications, showing up in purchase history

This commit is contained in:
Codex Agent
2025-11-21 11:25:45 +01:00
parent 07fe049b8a
commit 7a8d22a238
58 changed files with 3339 additions and 60 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class PackageAddon extends Model
{
use HasFactory;
protected $fillable = [
'key',
'label',
'price_id',
'extra_photos',
'extra_guests',
'extra_gallery_days',
'active',
'sort',
'metadata',
];
protected $casts = [
'active' => 'boolean',
'metadata' => 'array',
'extra_photos' => 'integer',
'extra_guests' => 'integer',
'extra_gallery_days' => 'integer',
'sort' => 'integer',
];
protected function increments(): Attribute
{
return Attribute::make(
get: fn () => [
'extra_photos' => (int) ($this->extra_photos ?? 0),
'extra_guests' => (int) ($this->extra_guests ?? 0),
'extra_gallery_days' => (int) ($this->extra_gallery_days ?? 0),
],
);
}
}