← Ticketfold

Ticketfold documentation

Installing on shared hosting (cPanel, Plesk, DirectAdmin, Hostinger…)

You don't need SSH or Composer. Everything Ticketfold needs is already in the zip.

What you need

Steps

  1. Upload. Unzip ticketfold-v1.0.0.zip on your computer. Upload the contents of the web/ folder to your hosting account, for example to /home/you/ticketfold/. Use your host's File Manager "Upload + Extract" option for speed.

  2. Point the domain at public/. In your control panel, set the document root of the domain (or subdomain, such as tickets.yoursite.com) to /home/you/ticketfold/public.

If your host does not let you change the document root, upload the files straight into public_html/. The included .htaccess file in the top folder sends every visitor into public/ and blocks access to the application files.

  1. Create a database (MySQL only). In cPanel → MySQL Databases, create a database and a user, and give the user All privileges on it. Write down the database name, user name and password.

  2. Run the installer. Open your domain in the browser, and you'll be taken to /install:

  3. Requirements: every line should be green. If a folder is not writable, set the storage/, bootstrap/cache/ and database/ folders to 755 (or 775) in the File Manager.
  4. Database: choose MySQL and enter the details from step 3, or choose SQLite.
  5. Site & admin account: enter your site name, currency and symbol, time zone, and whether other organisers can sell on your site (Marketplace mode), then your name, e-mail and a password.

  6. Done. You'll land on Admin → Settings, signed in. Add your logo and brand colour there, then follow 03-payments.md and 04-mail.md.

The installer locks itself when it finishes and stays locked while the site has an admin account. To start completely over, empty the database (or delete database/database.sqlite) and delete the file storage/installed.

Optional: cron job

Ticketfold works without a cron job, because unpaid orders release their seats automatically after 30 minutes. If you want Laravel's scheduler for your own additions, add:

* * * * * php /home/you/ticketfold/artisan schedule:run >> /dev/null 2>&1

Troubleshooting

Problem Fix
"500 Server Error" right after uploading Check that PHP is 8.3+ in your control panel's PHP version page.
Images don't show Make sure storage/app/public is writable. Ticketfold serves images itself, so storage:link is not needed.
"419 Page expired" Your session expired; reload the page. If it keeps happening, check that storage/framework/sessions is writable.
Need to see the real error Set APP_DEBUG=true in .env temporarily, and set it back to false when you're done. Logs are in storage/logs/.
Moving to another domain Change APP_URL in .env.

Keep .env safe. It contains APP_KEY, which signs every ticket QR code. If you change the key, all tickets already issued stop scanning. Back it up together with your database.

Using Cloudflare? Open .env in the File Manager and set TRUSTED_PROXIES=*.


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

  1. Go to dashboard.stripe.com → Developers → API keys. Copy the Publishable key (pk_test_…) and the Secret key (sk_test_…).
  2. Go to Developers → Webhooks → Add endpoint:
  3. URL: https://YOURDOMAIN/webhooks/stripe
  4. Events: checkout.session.completed, checkout.session.async_payment_succeeded
  5. Copy the Signing secret (whsec_…).
  6. 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

  1. Go to dashboard.razorpay.com → Account & Settings → API Keys. Generate a key and copy the Key Id and Key Secret.
  2. Go to Webhooks → Add new webhook:
  3. URL: https://YOURDOMAIN/webhooks/razorpay
  4. Choose a secret
  5. Events: payment.captured, order.paid
  6. 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

  1. Go to developer.paypal.com → Apps & Credentials, and create an app. Use a Sandbox app for testing.
  2. Copy the Client ID and Secret into Ticketfold.
  3. Set Mode to sandbox while testing and live when 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


E-mail

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

  1. 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.
  2. 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).
  3. 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).
  4. Point the camera at a ticket:
  5. Green, VALID: let them in. The guest name and ticket type are shown.
  6. Amber, ALREADY USED: the ticket was scanned before. The time and the staff member are shown.
  7. 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.
  8. 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.
  9. 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:

  1. 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

  2. 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/.

  1. Build as above. android/app/build.gradle.kts reads key.properties and 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


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.

Look and feel

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.