Ticketfold documentation
Installing on a VPS (Ubuntu + Nginx example)
sudo apt install nginx php8.3-fpm php8.3-{mysql,sqlite3,mbstring,xml,curl,gd,bcmath,zip} mysql-server
sudo mkdir -p /var/www/ticketfold && sudo chown $USER /var/www/ticketfold
unzip ticketfold-v1.0.0.zip -d /tmp/tf && cp -r /tmp/tf/web/. /var/www/ticketfold/
sudo chown -R www-data:www-data /var/www/ticketfold/storage /var/www/ticketfold/bootstrap/cache /var/www/ticketfold/database
sudo chown www-data /var/www/ticketfold # so the installer can create .env (you can revert after install)
Nginx site (/etc/nginx/sites-available/ticketfold):
server {
listen 80;
server_name tickets.example.com;
root /var/www/ticketfold/public;
index index.php;
client_max_body_size 8M;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.(?!well-known) { deny all; }
}
Enable the site, add HTTPS with sudo certbot --nginx, then open the domain and follow the web
installer (same steps as in the shared hosting guide).
Command-line install (optional)
Instead of the web installer you can do it by hand:
cp .env.example .env && php artisan key:generate
# edit .env: DB_CONNECTION, DB_DATABASE, DB_USERNAME, DB_PASSWORD, APP_URL, and TICKETFOLD_DB_READY=true
php artisan migrate --force
touch storage/installed
Then register at /register and promote your account to admin (use the e-mail you registered with):
php artisan tinker --execute 'App\Models\User::where("email", "you@example.com")->update(["role" => "admin"]);'
Demo data (test copy only)
To try every screen with sample events, orders and check-ins, load the demo data on a separate test
copy, never on your live site. It turns on the test payment gateway (free "payments"), replaces your
site name, time zone and commission, and adds three accounts whose passwords are public:
admin@ticketfold.test, events@ticketfold.test and door@ticketfold.test, all with demo1234.
TICKETFOLD_DEMO=1 php artisan db:seed --class=DemoSeeder --force
Without TICKETFOLD_DEMO=1 the command refuses to run on an installed or production site.
Performance
php artisan config:cache && php artisan route:cache && php artisan view:cache
Run these again after every update. For large events you can switch CACHE_STORE and SESSION_DRIVER
to redis, and QUEUE_CONNECTION to database with a queue worker under Supervisor. This sends the
ticket e-mails in the background.
Updating
Back up your database and .env, upload the new files over the old ones (keeping .env, storage/
and database/database.sqlite), then run php artisan migrate --force.
Behind Cloudflare or a load balancer
Add TRUSTED_PROXIES=* to .env (or the proxy IP addresses, comma-separated) so Ticketfold sees the
visitor's real IP address and HTTPS. Leave it empty when visitors connect to your server directly:
trusting proxies that aren't there lets anyone fake their IP address.
Payments
Turn gateways on in Admin → Settings → Payments. You can enable more than one, and buyers choose at checkout. Free tickets (price 0) never go through a gateway. Keys are stored encrypted in the database. If you leave a secret field empty when saving, the saved value is kept.
Always try test / sandbox keys first, with the provider's test cards.
Stripe
- Go to dashboard.stripe.com → Developers → API keys. Copy the Publishable key (
pk_test_…) and the Secret key (sk_test_…). - Go to Developers → Webhooks → Add endpoint:
- URL:
https://YOURDOMAIN/webhooks/stripe - Events:
checkout.session.completed,checkout.session.async_payment_succeeded - Copy the Signing secret (
whsec_…). - Paste all three into Ticketfold and tick Enabled in the Stripe box.
Buyers pay on Stripe Checkout (cards, Apple Pay, Google Pay, and the local methods you enable in Stripe). The order is confirmed when the buyer returns and by the webhook, so a closed browser tab never loses a paid order.
Razorpay
- Go to dashboard.razorpay.com → Account & Settings → API Keys. Generate a key and copy the Key Id and Key Secret.
- Go to Webhooks → Add new webhook:
- URL:
https://YOURDOMAIN/webhooks/razorpay - Choose a secret
- Events:
payment.captured,order.paid - Paste the key id, key secret and webhook secret into Ticketfold and tick Enabled in the Razorpay box.
Razorpay Standard Checkout opens as a popup on your site (UPI, cards, netbanking, wallets).
After the buyer pays, Ticketfold asks Razorpay to confirm the payment is captured before it issues
tickets. If your Razorpay account doesn't capture payments automatically (Account & Settings →
Payment capture), Ticketfold captures it for the order amount. If Razorpay can't confirm it at once,
the order waits and the payment.captured webhook issues the tickets a moment later, so set up the
webhook above.
Signatures are checked on every payment.
PayPal
- Go to developer.paypal.com → Apps & Credentials, and create an app. Use a Sandbox app for testing.
- Copy the Client ID and Secret into Ticketfold.
- Set Mode to
sandboxwhile testing andlivewhen you go live (with live credentials).
Buyers approve on PayPal and are sent back. Ticketfold then captures the payment and confirms it with PayPal's server. PayPal needs no webhook: if the capture reply is lost, Ticketfold asks PayPal for the order's real status before giving up, so a buyer is never charged without getting tickets.
Test gateway
Test payment gateway adds a "Test payment" option that marks the order paid without charging anything. It's handy for trying the system and for demos. Turn it off on a live site.
Seats are held for 30 minutes
Choosing tickets holds the seats for 30 minutes while the buyer pays. Stripe checkout pages close after that time, and the Razorpay and test pages send the buyer back to choose again. If a payment still arrives after the seats were sold to someone else (or after you cancelled the event), no tickets are issued and Ticketfold refunds the payment automatically. If the provider refuses the refund, the order shows Sold out: refund needed in Orders so you can refund it by hand.
Refunds
On an order page click Refund. For Stripe, Razorpay and PayPal orders, Ticketfold asks the provider to refund the payment in full. You can also mark an order refunded without contacting the provider (for example, if you refunded it by hand). Refunded tickets stop scanning straight away.
Currency and commission
- Currency, symbol and position are set in Settings → General & branding. Zero-decimal currencies (JPY, KRW…) are handled. The currency you choose must be supported by the gateways you enable (Razorpay mainly supports INR).
- Commission: if Marketplace mode is on, set a platform commission %. It's recorded on each paid order of other organisers' events and shown in Admin → Organisers. Payment always goes to the platform's gateway account, so you settle with organisers yourself.
Ticketfold sends buyers an e-mail with their tickets: one QR code per ticket inside the e-mail, plus a PDF attachment. It also sends password reset e-mails.
Set it up in Admin → Settings → E-mail:
| Field | Example |
|---|---|
| Mailer | smtp (or sendmail on some hosts, or log, which only writes mail to storage/logs for testing) |
| Host / Port | smtp.yourhost.com / 587 |
| Encryption | tls for port 587, ssl for port 465 |
| Username / Password | your mailbox login |
| From address / name | tickets@yourdomain.com / Your Events |
Click Send test to check it works.
Good SMTP choices: your hosting mailbox, Brevo, Mailgun, Amazon SES, Postmark or Zoho. Use a "from" address on your own domain and set up SPF/DKIM with your provider, so tickets don't land in spam.
Organisers can resend tickets from any order page. Buyers can also open their tickets at any time from the private link on the confirmation page.
Ticketfold Scanner app (iOS + Android)
The scanner/ folder is a Flutter app that door staff use to check tickets in.
How staff use it
- Enter your site's address (for example
tickets.example.com). The app checks that it's a Ticketfold site, then takes the name and brand colour from it. - Sign in with a staff, organiser or admin account. Create staff accounts in the dashboard under Door staff. Staff can only scan; they can't see money or edit events. Use one staff account per phone: the server allows up to 240 scans a minute per account, so several busy doors sharing one login can hit that limit (the phones then carry on from the saved guest list and sync later).
- Pick an event. The app downloads the guest list so it can keep working offline. The event list itself is saved too, so if the phone starts with no connection it shows the last list it downloaded (with an "Offline — showing saved list" note).
- Point the camera at a ticket:
- Green, VALID: let them in. The guest name and ticket type are shown.
- Amber, ALREADY USED: the ticket was scanned before. The time and the staff member are shown.
- Red: fake (bad signature), cancelled/refunded, a ticket for another event, or an unknown code. Each result has its own sound and vibration, so staff don't need to look at the screen for every guest.
- No QR? Tap Enter code and type the 12-character code printed under the QR (
XXXX-XXXX-XXXX), or find the guest by name, e-mail or order number on the Guests tab. - Status shows checked-in / sold, when the guest list was last synced (kept across restarts), any scans waiting to upload, any offline scans that were not accepted, and options for sound, vibration and offline mode.
Offline mode
If the connection drops, the app keeps scanning against its saved guest list and keeps a queue of check-ins. It uploads them automatically when the connection returns (or tap Sync now). Queues left over from other events (for example after the app was closed) are uploaded when the event list loads. A scan waits at most about 3 seconds for the server; after two scans in a row fail, the app checks tickets from the saved list straight away until a background sync gets through again. Wi-Fi login pages, redirects, any 5xx server or gateway error and 429 "too many requests" replies count as "offline" too, so a struggling server never stops the door.
If two phones admit the same ticket while offline, the first scan to reach the server wins, and the other phone lists the clash under Status → offline scans were not accepted after syncing. The same happens if an online scan timed out after the server had already answered "already checked in": the phone showed green from its saved list, and the server's answer appears there once it syncs. Scans the server refuses outright (for example the event was deleted) are listed there as well instead of being retried forever.
What offline checking can and can't catch. Online, the server checks the QR signature, so fake QR codes are refused. Offline, the app only looks up the 12-character ticket code in its saved guest list: it does not verify the signature. A made-up code is still refused (it isn't on the list), but a copied or hand-built QR that contains a real guest's code would be accepted offline, the same as typing that code. Duplicate entries are caught when the scans sync. Keep the phones online where you can, and use offline mode as a fallback.
The sign-in token is kept in the phone's secure store: the iOS Keychain (this device only, so it is never part of an iCloud or computer backup) or Android's Keystore-encrypted storage. Signing out (or Use a different site) deletes the token and all saved guest and event lists from the phone. Unsynced scans are kept and upload the next time the same account signs in to the same site; saved data is stored per site and per account, so switching sites never mixes guest lists.
Building the app
You need Flutter 3.41 or newer (stable, Dart 3.11), plus:
- Android: Android Studio, or the Android SDK command-line tools.
- iOS: a Mac with Xcode 26 and CocoaPods (brew install cocoapods).
cd scanner
flutter pub get
flutter run # on a connected phone
flutter test # 51 unit + widget tests
Make it yours before publishing
| What | Where |
|---|---|
| App name | android/app/src/main/AndroidManifest.xml (android:label) and ios/Runner/Info.plist (CFBundleDisplayName) |
| Android package id | Change before publishing: the app ships as com.lumiolab.ticketfold_scanner, and Google Play only accepts an id once. Edit android/app/build.gradle.kts → applicationId and namespace (for example com.yourcompany.scanner). If you change namespace, also move android/app/src/main/kotlin/com/lumiolab/ticketfold_scanner/MainActivity.kt to the matching folder (e.g. kotlin/com/yourcompany/scanner/) and change its first line to package com.yourcompany.scanner, or the app crashes on start |
| iOS bundle id | Change before publishing: the app ships as com.lumiolab.ticketfoldScanner. Open ios/Runner.xcworkspace in Xcode → Runner → Signing & Capabilities, set your own Bundle Identifier (for example com.yourcompany.scanner) and choose your Team. Also change the RunnerTests target to match (com.yourcompany.scanner.RunnerTests), or search ios/Runner.xcodeproj/project.pbxproj for com.lumiolab.ticketfoldScanner and replace every match |
| Icon | Replace assets/icon-1024.png and the icons in android/app/src/main/res/mipmap-* and ios/Runner/Assets.xcassets/AppIcon.appiconset, or use the flutter_launcher_icons package |
| Default colour | lib/src/app_controller.dart (brand). It's replaced by the colour set in Admin at runtime anyway |
| Lock to your site | Optional: in lib/src/screens/server_screen.dart, pre-fill your address so staff skip that step |
Release builds
flutter build appbundle --release # Android → build/app/outputs/bundle/release/app-release.aab
flutter build apk --release --target-platform android-arm64 # APK for direct install on door phones
flutter build ipa --release # iOS → upload with Xcode Organizer or Transporter
Android release builds contain 64-bit ARM code only (arm64-v8a, set with abiFilters in
android/app/build.gradle.kts), so the app runs on 64-bit Android phones only (almost every phone
since 2017). The prebuilt test APK in the package is the same.
Android signing. Store builds must be signed with your own upload key:
-
Create a keystore once (keep it and its passwords safe; you need the same key for every update):
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
-
Create
scanner/android/key.properties:storePassword=
keyPassword= keyAlias=upload storeFile=/Users/you/upload-keystore.jks
storeFile is an absolute path, or a path relative to scanner/android/app/.
- Build as above.
android/app/build.gradle.ktsreadskey.propertiesand signs release builds with that key. If the file doesn't exist, release builds stop with an error that explains what's missing, so a debug-signed build can't reach a store by accident.
For a quick test build on your own phones (signed with the debug key, which Google Play rejects), opt in explicitly:
flutter build apk --release --target-platform android-arm64 -PallowDebugSigning=true
# or: TICKETFOLD_DEBUG_SIGNING=1 flutter run --release
key.properties, *.jks and *.keystore are in .gitignore. Never commit them.
For iOS you need an Apple Developer account.
Door phones you manage yourself don't need a store at all. You can install the APK directly (Android), or use TestFlight or Apple Business Manager (iOS).
Camera and network notes
- On iOS, QR codes are read with Apple's Vision framework. On Android, with Google ML Kit. Both work offline. From photo reads a QR from a picture in the gallery (useful for screenshots sent by guests). It doesn't work in the iOS Simulator.
- A live site must use
https://. Over plainhttp://the staff password, the sign-in token and the guest list travel unencrypted, so anyone on the venue Wi-Fi can read them. The app refuseshttp://addresses on the internet: the connect screen explains why and nothing is sent. Plainhttp://works only for a test server on your own network (192.168.x.x,10.x.x.x,172.16-31.x.x,localhost,*.local), on both iOS and Android. The rule lives inlib/src/api.dart(isBlockedHttp), because Flutter's networking doesn't use Android's network settings. - Testing over
http://. A server on your own network needs no change. To test against anhttp://server elsewhere (never for a live event), build with--dart-define=TICKETFOLD_ALLOW_HTTP=true; the connect screen then shows a "Not secure" warning instead of refusing. Android'sandroid/app/src/main/res/xml/network_security_config.xmlrefuses cleartext by default for any Android-native code too; it has a commented<domain-config>block you can uncomment with your test server's address if a plugin ever needs it. - Android backups are turned off (
android:allowBackup="false"plusdata_extraction_rules.xml), so the sign-in token and guest lists never end up in a cloud backup or on another phone. On iOS the token is in the Keychain with "this device only" access, so it isn't copied into backups either. (Saved guest lists on iOS are ordinary app files; they are deleted when staff sign out.) - If camera access was denied, the scan screen explains how to turn it on in the phone's Settings and has a Try again button. Enter code and the Guests tab work without the camera.
- The camera reports the same QR many times a second; the app ignores a code while it stays in view and accepts it again once it has been out of view for about 3 seconds.
Scanner REST API (v1)
Base URL: https://YOURDOMAIN/api/v1. Send Accept: application/json. Authenticated calls need
Authorization: Bearer <token>.
| Method & path | What it does |
|---|---|
GET /ping |
{app:"ticketfold", api:1, site, brand_color}. Used by the app to check an address. |
POST /login |
Body {email, password, device_name} → {token, user}. Limited to 10 attempts a minute. |
GET /me |
The signed-in user. |
POST /logout |
Revokes the token. |
GET /events |
Events this user may scan: their own, their organiser's (staff), or all (admin). |
GET /events/{id} |
One event with its stats. |
GET /events/{id}/attendees[?since=ISO8601] |
Every ticket: {server_time, full, data:[{id, code, display_code, name, email, ticket_type, order, status, checked_in_at}], stats}. With since, only tickets changed after that time are returned, for incremental refreshes. |
POST /events/{id}/scan |
Body {code, device_scan_id?}. code can be the full QR text or the 12-character printed code. |
POST /events/{id}/sync |
Body {scans:[{code, device_scan_id, scanned_at}]} (max 500) → {results:[…], stats}. Sending the same device_scan_id again is safe. |
Scan result
{
"result": "ok" | "duplicate" | "invalid" | "forged" | "cancelled" | "wrong_event",
"message": "Welcome!",
"ticket": { …same shape as attendees… }, // when the ticket was found
"checked_in_at": "2026-12-03T19:04:11+00:00", // for duplicates: the first check-in
"stats": { "sold": 120, "checked_in": 87, "capacity": 200 }
}
QR format
TF1.<eventId>.<CODE>.<SIGNATURE>. The signature is an HMAC-SHA256 (16 base64url characters) keyed from
your APP_KEY, so tickets can't be made up without access to your server. Changing APP_KEY
makes every issued QR code invalid.
Customising
Branding (no code)
Admin → Settings → General & branding: site name, tagline, brand colour (used for buttons, tickets, e-mails and the scanner app), contact e-mail, footer text, currency, time zone and language.
Organisers and roles
| Role | Can |
|---|---|
| Admin | Everything, including settings, every event and every organiser's revenue. |
| Organiser | Create and manage their own events, orders, promo codes and staff. Sign-up is open at /register when Open sign-up is on. |
| Door staff | Use the scanner app and the web check-in desk for their organiser's events. |
Turn off Marketplace mode to run a single-promoter site. Then only admins create events.
Translating
All text is in web/lang/en.json. Copy it to, for example, web/lang/es.json, translate the values
(keep the keys and the :placeholders as they are), then choose the language in Settings → General & branding.
Laravel's validation messages live in lang/<locale>/validation.php. Run
php artisan lang:publish to get the English files as a starting point.
PDF tickets in other scripts (Hindi, Arabic, Chinese…)
Out of the box, PDF tickets are made with dompdf. It prints Latin, Greek and Cyrillic names (English, Spanish, German, Russian and so on). Names and event titles in Hindi or other Indian scripts, Arabic/Urdu, Chinese, Japanese or Korean print as empty boxes with it. The ticket web page and the e-mail are not affected: browsers and mail apps show every script.
To print those scripts in the PDF too, add the free mPDF library. Ticketfold picks it up automatically:
cd web
composer require mpdf/mpdf
No SSH on your host? Run the same command on your own computer inside web/, then upload the
web/vendor folder and web/composer.json / web/composer.lock.
- mPDF adds about 95 MB (mostly fonts) and uses about 60 MB of memory per PDF.
- Indian scripts, Arabic (joined, right to left), Chinese, Japanese, Korean and Thai are chosen per word, so a ticket can mix scripts.
PDF_ENGINEin.envforces one:auto(default: mPDF when installed),dompdformpdf.- mPDF is licensed GPL-2.0, so it is not included in the Ticketfold download. You install it yourself under its own licence.
Look and feel
- CSS:
web/public/css/app.css(plain CSS with variables, no build step needed). - Templates:
web/resources/views/(Blade). The public pages are inpublic/, the dashboard indashboard/, the ticket PDF intickets/pdf.blade.phpand the e-mail inmail/tickets.blade.php.
Code map
| Area | File |
|---|---|
| Ordering, stock holds, issuing tickets, refunds | app/Services/OrderService.php |
| Check-in rules (single use, signatures, offline sync) | app/Services/CheckinService.php |
| Payment gateways | app/Services/Payments/* (add your own by implementing PaymentGateway) |
| QR signing | app/Support/TicketSigner.php |
| Settings store | app/Support/Settings.php |
| Tests | tests/Feature/* (92 tests). The zip ships without the test tools to keep it small, so run composer install first (needs SSH), then php artisan test. |