lyrasoft / event-booking
LYRASOFT Event Booking Package
Package info
github.com/lyrasoft/luna-event-booking
Type:windwalker-package
pkg:composer/lyrasoft/event-booking
Requires
- php: >=8.4.6
- brick/math: *
- chillerlan/php-qrcode: ^5.0
- lyrasoft/luna: ^2.2
- lyrasoft/sequence: ^1.0
Requires (Dev)
- ecpay/sdk: ^1.3
Suggests
- lyrasoft/attachment: Install this if you want to ask attender upload certificate files.
- lyrasoft/member: Install this if you want to select tutors
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-copilot/fix-unverified-payment-info-issue
- dev-copilot/fix-event-checkin-security-issue
- dev-copilot/fix-receive-paid-method-validation
- dev-copilot/fix-checkout-server-validation
- dev-copilot/fix-unauthenticated-endpoint
- dev-copilot/fix-event-attend-limit
- dev-copilot/fix-ecpay-credentials-issue
This package is auto-updated.
Last update: 2026-12-01 07:02:52 UTC
README
Installation
Install from composer
composer require lyrasoft/event-booking
EventBooking dependents on lyrasoft/sequence Please read their README and configure them first.
Then copy files to project
php windwalker pkg:install lyrasoft/event-booking -t routes -t migrations -t seeders
Seeders
Add these files to resources/seeders/main.php
return [ // ... __DIR__ . '/venue-seeder.php', __DIR__ . '/event-seeder.php', __DIR__ . '/event-order-seeder.php', ];
Add these types to category-seeder.php
static function () use ($seeder, $orm, $db) { $types = [ // ... 'event' => [ 'max_level' => 1, 'number' => 10, ], // Venue catagoey is optional 'venue' => [ 'max_level' => 1, 'number' => 5, ], ];
Global Settings
WIP
Check-in
Check-in QR codes are signed with HMAC-SHA256 using a key derived from the application secret (APP_SECRET). Make sure APP_SECRET is set in every environment. Rotating APP_SECRET invalidates all existing check-in QR codes, so they must be regenerated.
Session
As EventBooking may need to redirect to outside Payment service to process checkout, you must disable SameSite cookie poilicy
and set secure as TRUE.
// etc/packages/session.php return [ 'session' => [ // ... 'cookie_params' => [ // ... 'secure' => true, // <-- Set this to TRUE // ... 'samesite' => CookiesInterface::SAMESITE_NONE, // Set this to `SAMESITE_NONE` ],
Language Files
Add this line to admin & front middleware if you don't want to override languages:
$this->lang->loadAllFromVendor('lyrasoft/shopgo', 'ini'); // OR $this->lang->loadAllFromVendor(EventBookingPackage::class, 'ini');
Or run this command to copy languages files:
php windwalker pkg:install lyrasoft/shopgo -t lang
Register Admin Menu
Edit resources/menu/admin/sidemenu.menu.php
$menu->link('活動', '#') ->icon('fal fa-calendar'); $menu->registerChildren( function (MenuBuilder $menu) use ($nav, $lang) { $menu->link('場館管理') ->to($nav->to('venue_list')) ->icon('fal fa-house-flag'); $menu->link('活動分類') ->to($nav->to('category_list')->var('type', 'event')) ->icon('fal fa-sitemap'); $menu->link('活動管理') ->to($nav->to('event_list')) ->icon('fal fa-calendar-days'); $menu->link('報名者管理') ->to($nav->to('event_attend_list')) ->icon('fal fa-users'); $menu->link('報名訂單管理') ->to($nav->to('event_order_list')) ->icon('fal fa-files'); } );
Payments
Add Ecpay Payment
Install Ecpay SDK
composer require ecpay/sdk
Register Ecpay payments
'payment' => [ // ... 'gateways' => [ // ... 'ecpay_credit' => fn () => create( \Lyrasoft\EventBooking\Payment\EcpayPayment::class, type: EcpayPaymentType::CREDIT, ), 'ecpay_atm' => fn () => create( \Lyrasoft\EventBooking\Payment\EcpayPayment::class, type: EcpayPaymentType::ATM ), 'ecpay_cvs' => fn () => create( \Lyrasoft\EventBooking\Payment\EcpayPayment::class, type: EcpayPaymentType::CVS ), ], ],
And add these to .env and .env.dist (ECPay credentials are required, there are no defaults)
# Development only: ECPay public sandbox credentials. Do NOT use in production. EVENT_ECPAY_MERCHANT_ID=2000132 EVENT_ECPAY_HASH_KEY=5294y06JbISpM5x9 EVENT_ECPAY_HASH_IV=v77hoKGq4kWxNNIS
In production, inject your real ECPay EVENT_ECPAY_MERCHANT_ID, EVENT_ECPAY_HASH_KEY and EVENT_ECPAY_HASH_IV from the deployment environment. Never commit them to the repository. If any of them is missing, the ECPay payment will throw an exception.
Add exclude to CsrfMiddleware for Ecpay notify URL
// routes/front.route.php ->middleware( CsrfMiddleware::class, excludes: [ // ... 'front::event_payment_task', ] )