FantasyEngine docs Fantasy Engine user guide
Version 1.0.0
  • 1.0.0 (this version)

Fantasy Engine user guide 1.0.0 / Getting started

Install

Admin

For the developer / QC team that installs the product on a server: requirements, configuration, the installer, the web server, cron and the first checks.

What you install#

Last updated: 2026-11-16 · v1.0.0

Fantasy Engine is one Laravel 13 application (PHP) with an AdminCP, a REST API and a web app. The same source also builds the Android and iOS apps (Expo). It is delivered as a zip, the sale package:

PackageFileContainsUse it when
Standardfantasyengine-<version>.zipLaravel source, production vendor/ (no Composer run needed), the built web app in public/, an empty storage/ skeleton, .env_exampleyou run the website, the AdminCP and the web app
Fullfantasyengine-full-<version>.zipeverything of the standard package plus resources/expo: the app source with sample .env, .env.production and sample Firebase files under their real namesyou also build the Android / iOS apps or change the web app

Neither package contains a real .env, a firebase.json, tests or the developers' notes. Both hold the files at the root of the archive (no top folder): unpack them straight into the site's folder. The packages are built with build_release.sh (Linux, macOS, Git Bash) or build_release.ps1 (Windows PowerShell); both give the same files. The product version is the one line of public/version.txt (1.0.0 today); the AdminCP shows it at the bottom right as Current Version.

Measured for 1.0.0 on 2026-11-16, the packages built from daily-fantasy b567338 (3e10186 changes the content of one app file only): standard fantasyengine-1.0.0.zip 37.1 MB / 20,964 files, full fantasyengine-full-1.0.0.zip 44.1 MB / 21,700 files. The 1.0.0 packages carry the fixes made to 1.0.0 since it shipped; the version stays 1.0.0 (no new number).

Verified on 2026-10-22: the standard package built by build_release.sh from daily-fantasy c68e20c was unpacked into a test folder and installed into an empty test database, once with the web installer and once from the command line.

Two ways to install#

Last updated: 2026-11-19 · v1.0.0

Upload, point the web server at public/, open the site in a browser. Five screens: requirements, database, site settings, admin account, finished. It writes .env for you.

B. Command line#

Create .env yourself, then run key:generate, three migrate passes and shaun_core:install. Good for scripted servers and containers.

Both end with the same database: 77 tables, 91 migrations, every row of the packages table at the product version (1.0.0). After either path you configure the web server, the cron line and the AdminCP settings (the sections Web server, The cron line and First login, in that order).

Verified on 2026-10-22: the standard package built by build_release.sh from daily-fantasy c68e20c was unpacked into a test folder and installed into an empty test database, once with the web installer and once from the command line. Counts re-checked on 2026-10-28 against the 7b8ff49: 85 migration files in the code, and the test database built by the command-line path holds 77 tables and 85 migrations. Re-checked on 2026-10-29 against the 94fe444: 90 migration files (five more shaun_df_1_0_0_modify_table_*: contest creator index, contest lineup, fixture start time, player statuses, players), and the test database holds 77 tables and 90 migrations. Re-checked on 2026-10-30 against the 5daa011: 91 migration files (one more, shaun_df_1_0_0_modify_table_df_player_positions: the flexible lineup slot), and the test database and the dev site each hold 77 tables and 91 migrations. Re-checked on 2026-11-05 against the 5e767e8: still 91 migration files (the one-order-per-gateway-payment index of wallet_orders was added inside its 1.0.0 migration), the test database 77 tables and 91 migrations.

The moving parts on a server#

Last updated: 2026-11-19 · v1.0.0

PartNeededGuide
Web server + PHP-FPM serving public/alwaysthis guide, Web server
MariaDB / MySQL databasealwaysthis guide
Cron: php artisan schedule:run every minutealways - contests go live, complete and pay out from itThe cron line
Queue workeroptional (the scheduler drains the queue every minute)The cron line
SMTP accountfor any e-mail (sign-up, password reset)Mail
Reverb server (or a Pusher account)optional: live updates; without it the app pollsRealtime
Firebase projectoptional: push notifications (mobile and web)Firebase & push
Fantasy Engine data feed (an api key that comes with your licence; outgoing HTTPS from the server)optional: leagues fed automatically with teams, players, fixtures, live scores and player stats; without it the results are entered by handAdminCP → Fantasy Engine → Data Feed (The first settings to fill; the user guide)
Node.js + Yarn, Android Studio / Xcodeonly to build the apps (full package)Build the apps

PHP#

Last updated: 2026-11-19 · v1.0.0

  • PHP 8.3 or newer (the package refuses to run below 8.3.0). Tested with 8.3.31 and 8.4.10.
  • PHP-FPM for the web server and the PHP CLI (same version) for cron and artisan.

Extensions#

ExtensionWhy
pdo, pdo_mysqlthe database
openssl, mbstring, tokenizer, json, curl, fileinfo, ctype, filter, hash, pcre, sessionLaravel
gd, exifimage uploads (avatars, logos)
zip, xml, xmlreader, xmlwriter, simplexml, dom, libxml, iconv, zlibExcel import / export of sports data (maatwebsite/excel)
sodiumrequired by the dependency set
bcmath or gmp, intlrecommended (money and phone-number libraries use them when present)

The installer's requirement page checks every extension above except the recommended ones, under the heading PHP extensions: openssl, pdo, pdo_mysql, mbstring, tokenizer, JSON, cURL, gd, zip, exif, fileinfo, ctype, dom, filter, hash, iconv, libxml, pcre, session, simplexml, sodium, xml, xmlreader, xmlwriter, zlib - every extension a package of the shipped vendor/ requires, plus the database driver and exif. A missing one shows a red mark and the page offers no next step until it is installed (then reload the page).

PHP settings#

SettingValue
memory_limit512M recommended (feed crawls and Excel imports of large leagues)
upload_max_filesize, post_max_sizeat least the AdminCP "Max upload size per file" plus some margin (e.g. 64M)
max_execution_time120 or more for AdminCP imports
proc_open, symlinkmust not be in disable_functions: the scheduler starts each task as a process, the installer links public/storage
opcache.enable1 - required on a production server (box below)
opcache.memory_consumption256 (MB)
opcache.max_accelerated_files32531: the package holds nearly 20,000 PHP files (with vendor/), more than the default 10000
opcache.validate_timestamps1 (the default) is safe. 0 is a little faster, but then PHP sees new files only after a reload: reload PHP-FPM after every update (the update steps already do)
realpath_cache_size4096K (the PHP default; raise it if your host set it lower)
Enable OPcache for the PHP that serves the site

Without OPcache PHP reads and compiles the code again on every request. Every page of the web app is answered by PHP (the page shell that loads the app) and every call of the app goes to the API, so a site without OPcache answers each of them many times slower, before anything is downloaded. Most Linux packages (php8.3-opcache) enable it by default; the official Docker php images ship it switched off: add RUN docker-php-ext-install opcache to the image (or docker-php-ext-enable opcache) and put the values above in an .ini file of /usr/local/etc/php/conf.d/. Check the PHP that serves the web pages, not only the command line:

php-fpm8.3 -i | grep -E '^opcache\.(enable|memory_consumption|max_accelerated_files) '
Expected
opcache.enable => On => On
opcache.max_accelerated_files => 32531 => 32531
opcache.memory_consumption => 256 => 256

Under Apache with mod_php use a page with <?php phpinfo(); (delete it afterwards), or php -i inside the container. Also keep APP_DEBUG=false (with true the site runs without its cache) and run php artisan optimize after the install and every update (.env keys).

PHP version and extension list read from composer.lock; installed and run on PHP 8.4.10 on 2026-10-22. The installer's list read from packages/shaunsocial/core/config/install.php of the 5daa011 on 2026-10-30 (kept equal to the ext-* of composer.lock by tests/Feature/Core/Install/RequirementsTest.php), its page shot from a test copy of that tree without .env. OPcache values (2026-11-19): the PHP file count from the 1.0.0 standard package (19,750 .php files); the other values are the recommended production values, not measured on this version.

Database#

Last updated: 2026-10-22 · v1.0.0

  • MariaDB 10.4+ or MySQL 8.0+ (tested with MariaDB 10.4.28 and 10.4.32).
  • An empty database with utf8mb4 / utf8mb4_unicode_ci and a user with all rights on it.
  • The application stores dates in UTC. The database session time zone does not matter: the code compares with the PHP clock.
MySQL / MariaDB console
CREATE DATABASE fantasyengine CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fantasyengine'@'localhost' IDENTIFIED BY 'a-strong-database-password';
GRANT ALL PRIVILEGES ON fantasyengine.* TO 'fantasyengine'@'localhost';
FLUSH PRIVILEGES;

Web server, TLS and other tools#

Last updated: 2026-11-19 · v1.0.0

WhatRequirement
Web serverApache 2.4 with mod_rewrite (required) and mod_headers (recommended), or at least mod_expires (the same cache lifetimes without immutable; Apache), and AllowOverride All on the folder. With mod_expires and without mod_headers, a narrower AllowOverride must include Indexes: AllowOverride FileInfo Indexes Options=Indexes,MultiViews; without it every file answers 500. Or nginx. Document root = the public/ folder.
HTTPSrequired in production: browsers allow web push and the mobile apps call the API only over HTTPS
Composer 2only when you deploy from the git source (the packages carry vendor/)
Node.js + Yarn 1.22only to build the web or mobile apps from the full package: Node 22 or 24 (this team builds with 24.x), npx [email protected]
Portsthe site on 443; a Reverb server, if used, listens on a local port (6060 by default) behind the web server
Outgoing HTTPSonly with the data feed: PHP must reach the feed address (AdminCP Api url, https://data.fantasyengine.net/api by default) on port 443 with an up-to-date CA certificate bundle (curl / OpenSSL). The site checks the feed's TLS certificate and sends nothing to an http:// address.
The Authorization header must reach PHP

The API accepts only the Authorization: Bearer ... header (no cookie). The shipped public/.htaccess passes it on Apache; nginx passes it by default. A custom proxy or FastCGI setup that drops it makes every web and app login end with "Something went wrong!". The check is in the Verification checklist.

Apache 2.4.56 + PHP-FPM 8.4.10 with the shipped .htaccess tested on 2026-10-22: the bearer header reached the API.

Unpack the package#

Last updated: 2026-11-19 · v1.0.0

  1. Copy the zip to the server and unpack it into the folder the site will live in (the zip has no top folder):
    mkdir -p /var/www/fantasyengine
    unzip fantasyengine-1.0.0.zip -d /var/www/fantasyengine
  2. Point the web server's document root at /var/www/fantasyengine/public (Web server).
  3. Give the PHP user write access (next section).
Shared hosting without a docroot setting

If the host serves the project folder itself, the root .htaccess serves only the files of public/ and sends every page to the site through server.php. It refuses .env, storage/ (logs included), vendor/, the composer files and every hidden path (Project folder as document root). Prefer the public/ docroot whenever you can.

Unpacked and served from public/ and, as a second test, from the project root (Apache 2.4.56) on 2026-10-22; the root .htaccess re-checked on Apache 2.4.58 on 2026-11-03 (project root and sub-folder).

File permissions#

Last updated: 2026-10-23 · v1.0.0

The web server user (here www-data) must be able to write:

PathWhy
storage/ (all of it)uploads (storage/app/public), cache, sessions, logs
bootstrap/cache/framework caches
.envthe installer writes it; saving the AdminCP Site url rewrites APP_URL in it
lang/, public/locales/language files: created at install, edited by AdminCP → Language
the project root and public/during the web install (it creates .env and the public/storage link)
public/_expo/for a site in a sub-folder (https://host/sub-folder): the web app is built for any address and the site writes its own path into public/_expo at install, when the AdminCP Site url changes and after an update (php artisan shaun_core:web_base does the same by hand). A site at a domain root never writes there.
cd /var/www/fantasyengine
chown -R www-data:www-data .
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 640 .env firebase.json 2>/dev/null   # once they exist

.env keys#

Last updated: 2026-11-19 · v1.0.0

The web installer writes .env; for the command-line install copy .env_example to .env and fill it. Many services are configured in the AdminCP, not here: mail, broadcast, push, storage and the cache driver are read from the settings, so their .env lines are not used.

KeyExampleRequiredWhat it does
APP_NAMEFantasyEngineyesprefix of the cache keys and the session cookie name (the site title is an AdminCP setting). The installer writes a random value.
APP_ENVproductionyes
APP_KEYbase64:...yesencryption key, of this site only. The web installer writes one; .env_example leaves it empty, so a command-line install runs php artisan key:generate --force. While it is empty every page answers 500 (log: "No application encryption key has been specified."). The PayPal and Stripe payments carry a mark made from this key, and the site credits only payments with its own mark: two sites on one PayPal / Stripe account (a test or stage copy of a site included) need different keys, or each credits the other's payments too; give a copy its own key (php artisan key:generate --force) before it takes payments. Changing the key of a live site leaves the payments open at that moment uncredited: they are listed as a warning in AdminCP → System Setting → System Log; check them at the gateway and credit them by hand.
APP_DEBUGfalseyestrue shows errors to visitors and switches the cache off: never in production
APP_URLhttps://your-site.exampleyeskept equal to the AdminCP Site url (saving that setting rewrites this line)
APP_ADMIN_PREFIXadminyesthe AdminCP lives at /<prefix>; letters, digits, -, _
LOG_CHANNEL, LOG_LEVELshaun, warningnoshaun = monthly file storage/logs/shaun-error-YYYY-MM.log; stack = laravel.log
DB_CONNECTIONmysqlyes
DB_HOST, DB_PORT127.0.0.1, 3306yes
DB_DATABASE, DB_USERNAME, DB_PASSWORDfantasyengine, fantasyengine, a-strong-database-passwordyes
DB_PREFIX(empty)notable prefix, only when the database is shared
CACHE_DRIVERfileyesdefault store; AdminCP → System Setting → Cache Setting can switch to Redis / Memcached. The cache also keeps the counts of the sign-in and request limits (wrong logins, password-reset mails and wrong codes, contact messages; TRUSTED_PROXIES below), so it must be one store that every server of the site shares and that lasts between requests. One server: Files (the default) is fine. Several servers behind a load balancer: Redis or Memcached in Cache Setting, and a shared store (Redis, database or Memcached) for SCHEDULE_CACHE_DRIVER when it is set (scheduled tasks); with Files each server counts on its own, so a guesser gets every limit once per server. The AdminCP Clear cache button, php artisan cache:clear and every update empty the store, and with it these counts.
SESSION_DRIVER, SESSION_LIFETIMEdatabase or file, 120yesAdminCP sessions (the API uses tokens)
QUEUE_CONNECTIONdatabase or syncyessee Queue worker; the web installer writes database
BROADCAST_DRIVERlognoleave it: the AdminCP Broadcast switch selects the Pusher protocol at run time
PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRETyour-app-id, your-app-key, your-app-secretfor Reverbthe credentials the local Reverb server accepts; the same three values go into AdminCP → Broadcast (Realtime)
REVERB_SERVER_HOST, REVERB_SERVER_PORT127.0.0.1, 6060for Reverbwhere php artisan reverb:start listens
REDIS_HOST, REDIS_PASSWORD, REDIS_PORTnoonly for a Redis cache / queue / Reverb scaling
FORCE_HTTPStruebehind a TLS proxygenerates https links when TLS ends at a load balancer
TRUSTED_PROXIES203.0.113.10,203.0.113.11, a CIDR range such as 203.0.113.0/24, or *behind a CDN, a load balancer or a reverse proxy on another hostthe addresses (or CIDR ranges, comma separated) of the proxies in front of the site. Only a request that comes from one of them may name the visitor's address, and only through the header named by TRUSTED_PROXY_HEADER (next row); from any other caller every address header (X-Forwarded-For, Cf-Connecting-Ip, X-Real-Ip) is ignored and the connection's own address counts. Every per-visitor limit counts on that address: the member login brake, the AdminCP login brake, the password-reset mails (at most 20 an hour per address) and code checks, the contact form (5 messages an hour per address), the maintenance-mode access code (10 tries a minute), the requests of a visitor who is not signed in (300 a minute) and the social sign-in address (60 requests a minute; a sign-in takes two). Without this key behind a proxy every visitor seems to come from the proxy and all visitors share one count: together they get 20 password-reset mails an hour, 5 contact messages an hour and 60 social sign-in requests a minute, and one guesser can lock the login of a member account or of an admin account for everybody. This holds for any proxy, also a reverse proxy on the same host or network (an nginx in front of Apache or of a container, a load balancer): version 1.0.0 does not recognise a local proxy by itself. A plain nginx or Apache that runs PHP itself is not a proxy. Behind Cloudflare: list Cloudflare's published IP ranges (https://www.cloudflare.com/ips/) here and set TRUSTED_PROXY_HEADER=cf-connecting-ip. Behind your own nginx or load balancer: its address, and the default header. * trusts whoever connects: any caller that reaches the web server directly can then name its own address in the header and get a fresh count with every request. Use * only when the web server accepts connections from the proxy alone, and prefer the address ranges. Empty (the default) = no proxy is trusted. After a change: php artisan config:clear (on a site that caches its configuration: php artisan optimize again, below).
TRUSTED_PROXY_HEADERx-forwarded-for (default), cf-connecting-ip or x-real-ipno (only with TRUSTED_PROXIES)the header your proxy writes with the visitor's address: x-forwarded-for for nginx, Apache or a load balancer that appends the visitor to X-Forwarded-For; cf-connecting-ip for Cloudflare; x-real-ip for a proxy that sets X-Real-IP. Only this header is read, and only from the addresses in TRUSTED_PROXIES; a proxy passes on the other address headers a visitor sends, so they are ignored even from a trusted proxy. With cf-connecting-ip or x-real-ip the visitor's address comes from that header only (a value that is not one IP address, or no header, leaves the proxy's address) and the X-Forwarded-For list a visitor sends is dropped; the proxy's X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Port still apply, so behind TLS the site's links and redirects stay https. Cloudflare writes X-Forwarded-Proto but not X-Forwarded-Host / X-Forwarded-Port, so one sent by a visitor would reach the site: have the proxy, or the web server in front of PHP, overwrite those two with its own values or remove them (Apache with mod_headers: RequestHeader unset X-Forwarded-Host and RequestHeader unset X-Forwarded-Port in the site's virtual host). The IP address ban of the AdminCP (Spam & Banning Tools) judges the same resolved address. Any other value counts as x-forwarded-for. The sample .env_example has the line TRUSTED_PROXY_HEADER=x-forwarded-for.
CDN_CLOUD_URL, ASSET_URLnoserve static files from a CDN
SHAUN_QUEUE(unset)noleave unset. true moves mails and notifications to named queues that need a worker of their own
SQL_LOG_ENABLE(empty)nodebugging only: logs every query to storage/logs/shaun-sql-*.log
FIREBASE_CREDENTIALS(unset)nothe Firebase service-account key the site pushes with; unset = firebase.json in the project root (GOOGLE_APPLICATION_CREDENTIALS is read when it is not set). A path, absolute or relative to the project root (Firebase & push)
MAIL_*not usedmail is configured in AdminCP → General Configuration → E-mail Settings
AWS_*not usedcloud storage is configured in AdminCP → System Setting → Storage System
APPLE_ISSUER_ID, APPLE_KEY_ID, APPLE_PRIVATE_KEY, APPLE_BUNDLE_ID, APPLE_ENV; the file server.jsonnot usedthe store credentials of in-app purchases are AdminCP settings only (Mobile Application → General Configuration: Android package name, Apple bundle id and the card In-App Purchase); nothing is read from .env or from a key file. In-app purchase is switched off in 1.0.0, so they stay empty (Build the apps, App identity)
REVERB_HOST, REVERB_PORT, REVERB_SCHEME(empty), 443, httpsnowritten by the web installer; the AdminCP Broadcast card decides where the site publishes
What the web installer writes for Reverb

PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRET (random, 16 characters each), REVERB_SERVER_HOST=127.0.0.1 and REVERB_SERVER_PORT=6060: Reverb starts with them as they are. Copy the three values into AdminCP → Broadcast (Realtime).

Cache the configuration on a production server

After the install (either path) and after every update, run php artisan optimize from the project root: it caches the configuration, the event map, the routes and the views, so a request reads a few cached files instead of .env and every config, route and view file. While the configuration is cached the site does not read .env: before you edit .env run php artisan optimize:clear, edit it, then run php artisan optimize again (an edit made while it is cached does nothing). The update and the AdminCP Clear cache button clear the cached configuration, routes and views (the site then works uncached): run php artisan optimize again after them. Every .env value the site uses is read through the configuration, so a cached site keeps your admin prefix, FORCE_HTTPS, TRUSTED_PROXIES, TRUSTED_PROXY_HEADER and the other keys of this table. A 1.0.0 package built before 2026-11-16 still read some keys straight from .env (the admin prefix, for example): on such a site do not cache the configuration until its files are updated (Update from a new sale package).

Key list read from .env_example and every env() call of config/ and packages/; the .env written by the web installer of the 9c4fba6 inspected on 2026-10-22 (own APP_KEY, PUSHER_APP_* read by config/reverb.php: tests/Feature/Core/Install/EnvironmentWizardTest.php).

A. Web installer, step by step#

Last updated: 2026-11-19 · v1.0.0

Create the empty database first. Then open the site at its final address (https://your-site.example): the installer stores the address you used as the site URL.

  1. Server Requirements. Any address of a site without .env redirects to /install/requirements. Every line must show a tick: PHP version, extensions, storage and bootstrap/cache writable, and the folders /, /public, /public/locales, /lang writable. Press Set Environment. Until .env exists the installer's pages use a temporary key of this copy, created on the first visit in storage/framework/install_key; the last step deletes that file.
    Installer step 1, server requirements
    install-wizard - Step 1, Server Requirements with the full PHP extensions list (2026-10-30)
  2. Environment Settings → Environment. Admin Prefix = the AdminCP address (admin gives /admin). Press Setup Database.
    Installer step 2, admin prefix
    install-wizard - Step 2, Environment (2026-10-22)
  3. Environment Settings → Database. Connection mysql, host, port, database name, optional table prefix, user and password. Press Install. The installer checks the connection ("Could not connect to the database." when it fails), writes .env, runs every migration and seeds the data. On an error it shows the log and deletes .env again: fix the cause, empty the database and start over.
    Installer step 2, database form
    install-wizard - Step 2, Database (2026-10-22)
  4. Site Settings. Site title, site e-mail and the default time zone (preset to London; the installer's step bar calls this step "Site Info"; the site URL is taken from the browser address). Press Next. When that address has a path (a sub-folder install) the installer writes it into the web app now; if public/_expo is not writable it stays on this step and says so: fix the owner and press Next again. The same package installs at a domain root or in any sub-folder, no rebuild.
    Installer step 3, site settings
    install-wizard - Step 3, Site Settings (2026-10-22)
  5. Create Admin Account. Name, e-mail, password twice (up to 50 characters). This account has the root role. Press Save.
    Installer step 4, admin account
    install-wizard - Step 4, Create Admin Account (2026-10-22)
  6. Installation Finished. The last step generates a new APP_KEY, leaves install mode, links public/storage, clears the cache and creates the English language files (lang/en.json, public/locales/en.json) from install.json, and deletes the temporary key storage/framework/install_key. "Application has been successfully installed." From now on /install/... answers 404.
    Installer finished
    install-wizard - Installation Finished (2026-10-22)

The .env it writes: APP_ENV=production, APP_DEBUG=false, LOG_CHANNEL=shaun, LOG_LEVEL=warning, CACHE_DRIVER=file, QUEUE_CONNECTION=database, SESSION_DRIVER=database, your database values, a random APP_NAME and APP_KEY, and random Reverb credentials PUSHER_APP_ID / KEY / SECRET with REVERB_SERVER_HOST=127.0.0.1, REVERB_SERVER_PORT=6060 (.env keys).

Walked end to end with a headless browser on the unpacked standard package on 2026-10-22 and again on a copy of the 9c4fba6 (no fallback key): 6/6 steps, every packages row 1.0.0, .env with its own APP_KEY and the PUSHER_APP_* lines, Reverb accepted the written key. The 1.0.0 of today installs 77 tables and 85 migrations (counted on 2026-10-28 against d2d8b13; the walks of 2026-10-22 gave 73 / 77, before the data-feed and late-correction tables).

B. Command line, step by step#

Last updated: 2026-11-19 · v1.0.0

  1. Create .env from the sample and fill it (.env keys):
    cd /var/www/fantasyengine
    cp .env_example .env
    nano .env        # APP_ENV, APP_DEBUG=false, APP_URL, DB_*, PUSHER_APP_* ...
  2. Generate the key (the sample's APP_KEY is empty; until it is set every page answers 500):
    php artisan key:generate --force
    Expected
    INFO  Application key set successfully.
  3. Run the migrations in the installer's order - framework, core, then every package:
    php artisan migrate --force --path=database/migrations
    php artisan migrate --force --path=packages/shaunsocial/core/database/migrations
    php artisan migrate --force
    Expected (each pass ends with DONE lines)
      2023_02_20_074317_create_jobs_table ........................... 12.20ms DONE
      ...
      shaun_core_1_0_0_modify_table_users .......................... 263.18ms DONE
      ...
      shaun_wallet_1_0_0_modify_table_users ......................... 10.63ms DONE
  4. Seed the data, set the site and create the root admin. Always pass all four arguments: without them the command uses the defaults shaunSocial, http://localhost, [email protected] / admin.
    php artisan shaun_core:install "Fantasy Engine" https://your-site.example [email protected] 'a-strong-admin-password' 
    Expected
    (no output, exit code 0)
    It seeds every package (core and wallet first), writes site title / e-mail / URL (an APP_URL other than http://localhost wins over the argument), sets a random API secret, creates the admin, copies the English language files, links public/storage, clears the cache and deletes storage/framework/install_key if a visit of the web installer left one. Run a second time it does nothing.
  5. Check the result:
    mysql -e "SELECT name, version FROM fantasyengine.packages; SELECT COUNT(*) FROM fantasyengine.migrations;"
    Expected for 1.0.0
    shaun_core           1.0.0
    shaun_wallet         1.0.0
    shaun_daily_fantasy  1.0.0
    shaun_gateway        1.0.0
    shaun_user_verify    1.0.0
    91
  6. On a production server, cache the configuration, routes and views (.env keys: run php artisan optimize:clear before any later edit of .env):
    php artisan optimize
    Expected
    INFO  Caching framework bootstrap, configuration, and metadata.
      config ........................................................ 16.79ms DONE
      events ......................................................... 0.51ms DONE
      routes ........................................................ 30.41ms DONE
      views ........................................................ 158.05ms DONE
If artisan stops on an empty database

Version 1.0.0 needs no special mode (tested). Should a later version stop with "Base table or view not found" before the migrations ran, prefix the commands with ALREADY_INSTALL=false (install mode for that one command).

Run on a second unpacked copy of the standard package on 2026-10-22: migrations 3 s, install under 1 s; the admin then logged in. Run again on a copy of the 9c4fba6: .env_example with the empty key, key:generate "Application key set successfully.", the 3 migrate passes and shaun_core:install exit 0, every packages row 1.0.0, 77 migrations, /api/init and /admin/login 200; with the key emptied again /admin/login answered 500 "No application encryption key has been specified." On 2026-10-28 the expected count was raised to 85 (the 8 data-feed and late-correction migrations of 1.0.0), read from the 7b8ff49 and from the schema the command-line path builds; on 2026-10-29 to 90 (5 more 1.0.0 migrations), read from the 94fe444 and from the test database; on 2026-10-30 to 91 (the flexible lineup slot migration), read from the 5daa011 and from the test database. The removal of install_key by the CLI install was run by the team on a fresh test install of the 5daa011 (key planted before, gone after; tests/Feature/Core/Install/EnvironmentWizardTest.php covers the web wizard's last step).

Step 6 run on 2026-11-16 on the code of daily-fantasy 3e10186 (the four DONE lines above), then php artisan optimize:clear; still 91 migration files, no migration or data step added since 1.0.0 shipped.

Apache#

Last updated: 2026-11-19 · v1.0.0

/etc/apache2/sites-available/fantasyengine.conf
<VirtualHost *:443>
    ServerName your-site.example
    DocumentRoot /var/www/fantasyengine/public

    <Directory /var/www/fantasyengine/public>
        AllowOverride All
        Require all granted
    </Directory>

    # PHP-FPM (adjust the socket to your PHP version)
    <FilesMatch "\.php$">
        SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>

    SSLEngine on
    SSLCertificateFile    /etc/ssl/your-site.example/fullchain.pem
    SSLCertificateKeyFile /etc/ssl/your-site.example/privkey.pem
</VirtualHost>

Enable mod_rewrite, mod_headers, mod_ssl, mod_proxy_fcgi (Debian / Ubuntu and the official Docker php:*-apache image: a2enmod rewrite headers, then reload Apache; the Docker image enables neither mod_headers nor mod_expires). The shipped public/.htaccess does the rest: front controller, the Authorization header for PHP, the browser cache lifetimes of the static files (below), and the bare /admin address (a folder of AdminCP assets of that name exists) handed to Laravel.

Browser cache of the static files#

Apache serves these files itself (PHP never sees them); public/.htaccess gives them a lifetime by file name:

FilesCache-Control (mod_headers)With mod_expires only
A name with a content hash: a - or . followed by 16 or more hex digits before the extension. That is the web app build: _expo/static/** (entry-<hash>.js, the screens loaded on demand, styles) and assets/** (fonts, images: name.<hash>.woff2). A new build gives new names, so a browser never keeps an old copy.public, max-age=31536000, immutable (1 year)max-age=31536000 + Expires
Every other image, style, script or font (jpg jpeg gif png webp avif svg ico css js mjs woff2 woff eot ttf otf): images/**, the AdminCP files admin/**, the installer files, uploads storage/files/**, favicon.ico. They keep their name across updates.public, max-age=604800 (7 days)max-age=604800 + Expires
The service worker scripts firebase-messaging-sw.js and sw.jsno-cachemax-age=0 + Expires
Anything else (json, txt, the pages)no rule (the pages are answered by PHP)

Without mod_headers the same file reads its mod_expires rules instead. Those need Indexes in AllowOverride (All includes it): under a narrower value such as AllowOverride FileInfo Options=Indexes,MultiViews an Apache with mod_expires and without mod_headers answers 500 for every file; use AllowOverride FileInfo Indexes Options=Indexes,MultiViews or enable mod_headers. With mod_headers enabled the mod_expires rules are not read. The AdminCP's own scripts admin/js/main.js and admin/js/global.js are loaded with the site's cache number in their address (?v=<n>), which every update and the AdminCP Clear cache button raise, so a browser fetches them again after an update whatever their lifetime.

Check after the install (replace the address; add the sub-folder if there is one)
ENTRY=$(curl -s https://your-site.example/lobby | grep -o '_expo/static/js/web/entry-[0-9a-f]*\.js' | head -1)
curl -sI "https://your-site.example/$ENTRY" | grep -i '^cache-control'
curl -sI https://your-site.example/images/default/logo.png | grep -i '^cache-control'
curl -sI https://your-site.example/firebase-messaging-sw.js | grep -i '^cache-control'
Expected (with mod_headers)
Cache-Control: public, max-age=31536000, immutable
Cache-Control: public, max-age=604800
Cache-Control: no-cache

With mod_expires only: max-age=31536000, max-age=604800, max-age=0. No Cache-Control line at all means neither module is enabled (a2enmod headers, reload Apache). A CDN in front (Cloudflare, CloudFront ...) should keep the origin's cache headers: set its browser cache setting to respect the existing headers, or the CDN may replace the year of the build files by its own shorter default (Cloudflare: 4 hours). Run the same three lines through the CDN address.

Tested behaviour: /admin answers 301 to /admin/, then 302 to the dashboard or the login; the API received the bearer token through PHP-FPM.

Apache 2.4.56 + PHP-FPM 8.4.10 on 2026-10-22, docroot public/ and docroot project root. Cache lifetimes, file patterns and the mod_expires fallback read from public/.htaccess of c0645f6 on 2026-11-19 (the product's own test of that file checks the patterns and lifetimes; it was not run on a real Apache for this version).

Project folder as document root (root .htaccess)#

Last updated: 2026-11-19 · v1.0.0

Point the document root at public/ whenever the host allows it: the .htaccess of the project folder is then not used. It exists for two cases only: a host whose document root is fixed to the project folder, and a site in a sub-folder of another site (https://host/sub-folder, a real folder under the host's document root). In both cases it serves nothing that lives outside public/:

RequestAnswer
A path with a hidden part: /.env, /.env_example, /.git/config, /.htaccess403. Inside public/ (/public/.htaccess) 404. .well-known is the one exception.
An address with a file extension: /version.txt, /manifest.json, /firebase-messaging-sw.js, /_expo/..., /storage/<upload>, /install/css/main.cssThe file of public/ with that path, with the cache headers of public/.htaccess. When public/ has no such file, the site's own "not found" page: /composer.json, /storage/logs/laravel.log, /vendor/autoload.php, /bootstrap/app.php never reach the file of that name, and no PHP file outside public/ is run.
Any other address: /, /admin, /admin/login, /api/..., /installThe site, through server.php, which keeps the sub-folder as the base address. The Authorization header is passed to PHP.
/.well-known/acme-challenge/<token>, /.well-known/pki-validation/<file>The token file in the project folder when it exists (Let's Encrypt, cPanel AutoSSL write it there); otherwise the one in public/.well-known.
Any address on an Apache without mod_rewrite404. The site cannot run without mod_rewrite; this way the files are not handed out while you enable it.

Needs mod_rewrite and mod_alias (both standard), and AllowOverride All on the folder, or AllowOverride FileInfo Options=Indexes,MultiViews when mod_headers is enabled. On an Apache with mod_expires but without mod_headers it must be AllowOverride FileInfo Indexes Options=Indexes,MultiViews: the cache rules of public/.htaccess use mod_expires there, its directives need Indexes, and without it every file answers 500 (Apache, browser cache). The file has no Require line, so AuthConfig is not needed.

Check after the upload (replace the address; add the sub-folder if there is one)
curl -s -o /dev/null -w '%{http_code}\n' https://your-site.example/.env            # 403
curl -s -o /dev/null -w '%{http_code}\n' https://your-site.example/composer.json   # 404
curl -s -o /dev/null -w '%{http_code}\n' https://your-site.example/version.txt     # 200
curl -sL https://your-site.example/storage/logs/ | head -c 300       # 404 or the HTML of the web app, never a folder list ("Index of")
curl -sL https://your-site.example/vendor/autoload.php | head -c 300 # 404 or the HTML of the web app, never PHP source ("<?php")

Neither address is a file of public/, so the site answers with its own page: an address without a file extension (/storage/logs/), or one whose extension is not a web asset (.php, .log), gets the HTML of the web app with status 200, and in a browser the app shows its "not found" page ("Oops! This Page Missed the Draft…"); a missing web asset (.json, .js, .css, images ...) answers 404. A log file name such as /storage/logs/laravel.log must answer the same way, and none of these addresses may show file contents or a folder list. If one does, the web server is not reading the .htaccess of the project folder (check AllowOverride and that mod_rewrite is enabled), or the document root should be set to public/.

Not covered

A folder reached through an Apache Alias outside the document root (it needs a RewriteBase; not supported). Any extra .htaccess you add inside a sub-folder of the project replaces these rules for that sub-folder: do not add one.

Apache 2.4.58 + php-cgi 8.3 over FastCGI on 2026-11-03, project folder as document root and as the sub-folder /sub/: 17 paths outside public/ refused, 9 public files served byte-equal (the upload under storage and the ACME token included), 8 pages reached the site through server.php (the bearer header arrived, the installer and its assets worked in both layouts). The same with AllowOverride FileInfo Options=Indexes,MultiViews. Without mod_rewrite every address answered 404 (the earlier file served .env as is there). A public/ document root behaves as before. Re-read on 2026-11-19 against 3bf3581: the root .htaccess is unchanged since 49878b6, and the product's own check of it lists /storage/logs/, /storage/logs/laravel.log and /vendor/autoload.php among the paths that never reach a file outside public/; the answers of the two new lines are read from the site's routes (the app page for any other address, 404 for a missing web asset).

nginx#

Last updated: 2026-11-19 · v1.0.0

/etc/nginx/sites-available/fantasyengine
server {
    listen 443 ssl http2;
    server_name your-site.example;
    root /var/www/fantasyengine/public;
    index index.php;
    client_max_body_size 64m;

    ssl_certificate     /etc/ssl/your-site.example/fullchain.pem;
    ssl_certificate_key /etc/ssl/your-site.example/privkey.pem;

    # public/admin is the AdminCP assets folder: the bare /admin address must reach Laravel,
    # otherwise "try_files $uri/" finds the folder and nginx answers 403.
    location = /admin {
        rewrite ^ /index.php last;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_read_timeout 120;
    }

    location ~ /\.(?!well-known) {
        deny all;
    }

    # Browser cache, the same lifetimes as public/.htaccess (keep these blocks after the deny block above:
    # nginx takes the first regex location that matches). A name with a content hash: a year.
    location ~* "[.-][0-9a-f]{16,}\.(jpg|jpeg|gif|png|webp|avif|svg|ico|css|js|mjs|woff2|woff|eot|ttf|otf)$" {
        add_header Cache-Control "public, max-age=31536000, immutable";
        try_files $uri /index.php?$query_string;
    }

    # The service workers: never kept without asking.
    location ~ "(^|/)(firebase-messaging-sw|sw)\.js$" {
        add_header Cache-Control "no-cache";
        try_files $uri /index.php?$query_string;
    }

    # Every other image, style, script or font: 7 days.
    location ~* "\.(jpg|jpeg|gif|png|webp|avif|svg|ico|css|js|mjs|woff2|woff|eot|ttf|otf)$" {
        add_header Cache-Control "public, max-age=604800";
        try_files $uri /index.php?$query_string;
    }
}

server {
    listen 80;
    server_name your-site.example;
    return 301 https://$host$request_uri;
}
  • With a custom APP_ADMIN_PREFIX the location = /admin block is not needed (no folder has that name); keep it anyway, it does no harm.
  • nginx passes every request header to PHP-FPM, Authorization included. Check it with the curl test of the Verification checklist.
  • Reverb behind nginx: Realtime → Reverb behind the web server.
  • nginx ignores .htaccess: without the three cache blocks it sends no Cache-Control for the static files. Check them with the curl lines of Apache, browser cache (expected: the mod_headers values).

Written from the Laravel front-controller rules and the finding that /admin was answered by the assets folder; nginx is not installed on the test machine, so this block was not run. The cache blocks (2026-11-19) are written from the patterns and lifetimes of public/.htaccess and were not run either.

HTTPS and a proxy in front#

Last updated: 2026-10-22 · v1.0.0

  • Set the AdminCP Site url to the https:// address. Every asset of the page shell (/_expo/static/...) and every link in mails and pushes is built from it: a wrong value breaks CSS / JS loading.
  • When TLS ends at a load balancer or CDN, add FORCE_HTTPS=true to .env.
  • Run the cron and queue commands on one server only (their locks are in the file cache of that server).

The cron line#

Last updated: 2026-10-29 · v1.0.0

Everything that happens by itself - contests going live, completing and paying out, mails of the queue, clean-up - runs from Laravel's scheduler. Add one cron entry for the web server user:

crontab -u www-data -e
VPS
* * * * * cd /var/www/fantasyengine && php artisan schedule:run >> /dev/null 2>&1
cPanel "Cron Jobs" (every minute)
/usr/local/bin/php /home/your-user/fantasyengine/artisan schedule:run >/dev/null 2>&1

AdminCP → System Setting → Tasks prints these two lines with your real path and shows whether the scheduler runs: Succeeded: last on 2 minutes ago once shaun_core:task_check (every five minutes) has run, No, cron job configuration is not correct. before. Below it the page lists every scheduled command with its cron expression.

AdminCP Tasks page
cron - AdminCP → System Setting → Tasks, a local development site without cron (the two lines carry that machine's path) (2026-10-29)
See the schedule
php artisan schedule:list
Expected: 20 entries
  */5 *    * * *  php artisan shaun_core:task_check ........ Next Due: 1 minute from now
  *   *    * * *  php artisan shaun_core:mail_send ......... Next Due: 1 second from now
  ...
  20  2    * * *  php artisan shaun_daily_fantasy:crawl_schedule
  50  *    * * *  php artisan shaun_daily_fantasy:crawl_schedule --due
  ...
  *   *    * * *  php artisan queue:work --stop-when-empty --max-time=59

schedule:list and one schedule:run on the test install on 2026-10-22: every due task ended DONE. schedule:list on the 7b8ff49 on 2026-10-28: 19 entries (the data-feed log clean-up feed_prune is new). schedule:list on the 94fe444 on 2026-10-29: 20 entries (the hourly crawl_schedule --due is new).

What each scheduled command does#

Last updated: 2026-11-19 · v1.0.0

Times are UTC (the application clock).

CommandWhenDoes
shaun_daily_fantasy:check_liveevery minute (overlap lock 10 min)starts contests at their start time (a contest nobody entered goes straight to cancelled), cancels and refunds those short of entries, completes finished events and contests and pays the prizes in time-boxed batches. A contest of a league with the data feed completes only once the league's Settle delay (default 120 minutes) has passed after its last fixture finished; it also pays the re-settle top-ups an admin confirmed
shaun_daily_fantasy:auto_contest01:30 and 13:30 (overlap lock 60 min)creates the contests of the auto-contest templates for active, new events starting within the set number of days, on fixtures with a known kick-off time; a game type the league does not offer is skipped (one warning per template and type in the log)
shaun_daily_fantasy:crawl_team / crawl_player / crawl_schedule01:00 / 01:10 / 02:20data feed: teams (and then the players of the league in one request, with each player's injury status), players of a league without teams, fixtures of the next 14 days. Run only while a league is fed by the data feed
shaun_daily_fantasy:crawl_schedule --dueevery hour at :50 (overlap lock 30 min)data feed: reads the fixtures again for a league whose last schedule read failed or never ran (so a failed nightly read is retried every hour, not the next night) and for a league with a fed fixture kicking off today, once its last read is about 6 hours old (config schedule_refresh). One request per league; at most 3 extra reads a league on a match day
shaun_daily_fantasy:crawl_statsevery minute (overlap lock 10 min)data feed: live scores and player stats. Each minute it decides what is due: a fixture a contest is played on is read every 3 minutes while in play, a league scoreboard every 3 minutes while a fixture waits for its kick-off, a finished fixture every 10 minutes during the settle delay; after the play window a fixture still not closed is read every 30 minutes, and given up 48 hours after kick-off (MLB 96, PGA 120, F1 72; listed on the Data Feed screen) - then only every 6 hours while a live contest is played on it. A started fixture no contest is played on is only followed on its league scoreboard every 30 minutes and its stats are read once, when it closes. A turn sends nothing new after 45 seconds (the rest is read first in the next minute); stats and scoreboard reads time out after 10 s. Only with a league fed by the data feed
shaun_daily_fantasy:feed_prune03:40deletes the data-feed request log (Data Feed screen, Last requests) older than 14 days
queue:work --stop-when-empty --max-time=59every minute (overlap lock 5 min)runs the jobs waiting in the default queue (contest start / cancel, feed crawls, auto contests) when QUEUE_CONNECTION=database
shaun_core:mail_sendevery minutesends queued mails, Mail count per run (only when Email queue is on)
shaun_core:mail_daily_runevery 2 minutesthe daily digest e-mails of unread notifications
shaun_core:user_delete_runevery 2 minutesremoves accounts whose deletion was requested
shaun_core:storage_transferevery minutemoves files to another storage after a transfer was started in Storage System
shaun_core:task_checkevery 5 minutesrecords the run time shown on the Tasks page
shaun_core:task_check_tmp_fileevery 5 minutesdeletes abandoned temporary uploads
model:pruneevery 5 minutes (overlap lock 60 min)deletes data no longer needed: orphan files, expired tokens, old notifications, old verification codes, identity documents uploaded but never submitted; at most 500 rows of each kind per run (core config shaun_core.core.prune_limit; before 2026-11-02 the page-size setting Item per page, every minute)
cache:gc00:00removes expired file-cache entries
shaun_wallet:notify_balanceevery minutewallet balance notices
shaun_wallet:sweep_pending_depositsevery 5 minutescancels deposits left at the payment gateway
shaun_wallet:fail_stuck_processing02:15fails deposits stuck "in process" for more than 14 days
A killed process costs minutes, not a day

Every overlap lock above expires after the minutes shown, and so do the per-item job locks: a contest's start / completion / cancel job (10 minutes), a fixture's stats read (5 minutes), a league's crawl job (15 minutes). A server restart or a killed worker therefore holds one contest or fixture back for at most those minutes; a second run after the expiry changes nothing that the first already did. Before 2026-10-29 a dead holder could stop a contest or a fixture read for 24 hours.

Overlap locks hold with APP_DEBUG=true too (2026-11-02)

The overlap locks are kept in a cache store: cache.schedule_store (or the SCHEDULE_CACHE_DRIVER / SCHEDULE_CACHE_STORE key of .env) when set, else the site's cache store (CACHE_DRIVER or AdminCP → Cache Setting), else the file cache. With APP_DEBUG=true the site runs without a cache, and before 2026-11-02 the locks then guarded nothing: a slow run got a second copy beside it every minute. Nothing to set. A site that changed config/cache.php itself: a schedule_store entry there wins; the store it names must be one every server running cron reaches (file on one server, Redis / database / Memcached on several). The same store also keeps the job locks (a contest's start / completion / cancel, the feed crawls, the push notices: one queued copy at a time) and the wallet's per-member lock, so they hold with APP_DEBUG=true too; a site that sets a schedule_store must give it a store every server running cron or a queue worker reaches.

Read from the schedule definitions; the main list confirmed by schedule:list on the 94fe444 (2026-10-29, 20 entries). 2026-11-02 on c4a5100: schedule:list shows */5 * * * * php artisan model:prune ... (20 entries); on the dev site (APP_DEBUG=true, no cache store) every entry's lock is on the file store and a second lock of the same entry is refused (tests/Feature/Core/Console/ScheduleMutexTest.php).

Database limits of the scheduled commands#

Last updated: 2026-11-02 · v1.0.0

schedule:run runs most entries one after another in the foreground. When cron (through schedule:run) or you on the command line start one of the scheduled commands, its database connection gets limits, so a database that hangs ends the command with an error in the log instead of keeping it, and every entry after it, waiting for ever. schedule:run itself gets a read and a connection limit (row scheduler): before it starts an entry it checks whether the entry should run (for the data-feed crawls: is a league fed?), and that check reads the database. Nothing to set: the defaults are in the package config shaun_daily_fantasy.command_db.

Config shaun_daily_fantasy.command_dbDefaultWhat it bounds
commandsshaun_daily_fantasy: (every command of the package), shaun_core:task_check, mail_send, storage_transfer, mail_daily_run, user_delete_run, task_check_tmp_file, model:prune, shaun_wallet:notify_balance, sweep_pending_deposits, fail_stuck_processingthe commands that get the three limits below - every scheduled command but cache:gc (file cache only) and the queue worker
statement_seconds30a wait for a row lock or a table / metadata lock (also a backup's global read lock), and on MariaDB any statement: innodb_lock_wait_timeout, lock_wait_timeout, max_statement_time of the session. On MySQL a slow statement that waits on no lock is not ended.
read_seconds45a database server that does not answer at all (host or network down): mysqlnd.net_read_timeout. It ends the client side only.
connect_seconds10a connection attempt (PDO::ATTR_TIMEOUT).
workerlock_seconds 30, read_seconds 90, connect_seconds 10the scheduled queue:work --stop-when-empty: lock waits end after 30 s, but its jobs' statements have no time limit (a job of any package may need longer); the read limit is above the worker's own 60-second job timeout, so it only ends a wait on a server that does not answer (the worker's read of the queue has no timeout of its own).
schedulerread_seconds 30, connect_seconds 10schedule:run itself: a read of a server that does not answer ends after 30 s, a connection attempt after 10 s; no lock or statement limit (its reads take milliseconds). The limit is per read, and every entry it starts is a process of its own, so a long entry is not cut by it. Without it a hung database kept every schedule:run waiting (up to a day) and cron started one more each minute.

What it protects against: while the database hangs, every expired overlap lock lets cron start one more process of the same command (and model:prune and task_check have none: one more every minute / five minutes), and before these limits each of them waited until the database came back and then all ran at once, while the foreground ones held schedule:run for the length of the hang. Now each run ends within its own time box plus a minute or two and logs its error. check_live and crawl_stats stay in the foreground before the queue worker (the last entry), so with QUEUE_CONNECTION=database the worker runs the jobs they dispatched in the same minute; a run of theirs that waits on the database holds the entries after it for its time box plus about 30-90 seconds.

Set a value to 0 to switch that limit off (a site with a statement of these commands above 30 s - none is known - raises statement_seconds). Not covered: web requests, Artisan::call() in any form (the installer, tools run in-process), migrate, shaun_core:install / update and a queue worker of your own (Supervisor, without --stop-when-empty); schedule:run gets the read and connection limits only (row scheduler); a site that set its own PDO init command keeps it (then no session limits).

Real artisan processes on the test database, 2026-11-02: model:prune --pretend and shaun_daily_fantasy:feed_prune ran with lock waits 30 / 30, statement limit 30, read 45; queue:work --stop-when-empty with 30 / 30, no statement limit, read 90; queue:work --once (a worker of your own) with the server defaults. schedule:run (since the review fixes of 2026-11-02): read 30, connect 10, lock waits and statements unchanged (CommandDbLimitsTest).

Queue worker - when you need one#

Last updated: 2026-10-29 · v1.0.0

QUEUE_CONNECTIONBehaviourWorker needed
database (web installer default)jobs wait in the jobs table; the scheduled queue:work picks them up within a minute (its overlap lock expires after 5 minutes, so a killed run is replaced at the latest then). AdminCP → Fantasy Engine → Data Feed, row Queue, shows the feed crawl jobs waiting and failedno - a worker only makes it faster
synceach job runs at once inside the request or the cron command that made itno

Mails and push notifications are not queued jobs by default: they are sent at once (or through the mail outbox, see Mail). For a faster queue add a worker under Supervisor:

/etc/supervisor/conf.d/fantasyengine-worker.conf
[program:fantasyengine-worker]
command=php /var/www/fantasyengine/artisan queue:work --queue=default --sleep=3 --tries=1 --max-time=3600
user=www-data
numprocs=1
autostart=true
autorestart=true
stdout_logfile=/var/www/fantasyengine/storage/logs/worker.log
SHAUN_QUEUE=true needs its own worker

With SHAUN_QUEUE=true mails and notifications go to the queues notification, mail_normal and mail_many, which the scheduled worker does not read. Then run queue:work --queue=default,notification,mail_normal,mail_many permanently. The product is tested with SHAUN_QUEUE unset.

After every update: php artisan queue:restart (a running worker keeps the old code).

queue:work --queue=default,notification,mail_normal,mail_many --stop-when-empty ran on the test install on 2026-10-22 ("Worker STOPPED Queue empty").

First login#

Last updated: 2026-10-28 · v1.0.0

  1. Open https://your-site.example/admin (or your prefix). It redirects to the login form; sign in with the admin account of the install.
  2. The dashboard shows users, contests, events and, at the bottom right, Current Version. The buttons Visit site and Clear cache are on every page.
AdminCP dashboard
first-login - AdminCP dashboard of a local site with demo data (2026-10-22)

The first settings to fill#

Last updated: 2026-11-05 · v1.0.0

Settings save themselves as you leave a field.

Where (AdminCP menu)SettingsNotes
Site Settings → Site Information → Website SettingsSite title, Site email, Site url, Timezone default, Maintenance modeSite url = the https address; saving it also rewrites APP_URL in .env
Site Settings → Site Information → Android & IOS Appsstore links shown on the websiteonce the apps are published
Site Settings → General Configuration → E-mail Settingssender, SMTP server, queueMail; test with Test send mail
Site Settings → General Configuration → Broadcastrealtime serverRealtime
Site Settings → General Configuration → Progressive Web Appweb pushFirebase & push
Site Settings → General Configuration → Fantasy Enginedate formats, site profit %, entry fees, prize split, contest page size, auto-contest days, Money features in the mobile app, data feed Api url, Members can create contests (on), Max open contests per member (10), Max contests a member can create per day (5)leave Api url at https://data.fantasyengine.net/api unless told otherwise; money-off mode: Build the apps; the three member settings (keys shaun_daily_fantasy.member_create_contest, member_open_contest_max, member_daily_contest_max; 0 = no limit) are explained in the user guide
Fantasy Engine → Data FeedApi key (the key that comes with your licence), Verify the TLS certificate of the data feed, Sync dataonly with the data feed. The key is typed here, not on the settings page: a password field (empty = keep the stored key, Remove key clears it); afterwards the screen shows only •••• <last 4>. Leave the TLS check on (Yes); the Status row should then say "Working: last answer on ...". Then press Sync data (Overview tab, card Purchased leagues) to create the leagues of your licence with their positions and scoring categories (the Draft player game needs them); each fed league has its own Settle delay (Sports → league → Edit, default 120 minutes). The user guide explains the screen.
Mobile Application → General ConfigurationApp scheme (fantasyengine://)deep link back into the app after a social login; must match the app build. Android package name, Apple bundle id and the card In-App Purchase below are the store credentials of in-app purchases: leave them empty, in-app purchase is switched off in 1.0.0
Billings → Manage Payment GatewaysPayPal, Stripethe two gateways of deposits on the website; turn on and fill the one(s) you use (Billings → Manage Currencies for the currency). Without an active gateway members cannot add credits
System Setting → Tasks-confirm the cron line works
System Setting → Cache Settingfile (default), Redis, Memcachedused only while APP_DEBUG=false
System Setting → Storage Systemlocal disk or cloud storageuploads
Website Settings card
first-settings - Site Information → Website Settings, fields blanked for the shot (2026-10-22)
Fantasy Engine settings card
first-settings - General Configuration → Fantasy Engine, with the three member contest settings at the end; the api key is not on this card (2026-10-29)
Data Feed screen
first-settings - Fantasy Engine → Data Feed, tab Overview of a local demo site without a key: Connection (Api key, TLS check, Status, Queue), a Contests still live card and Purchased leagues; the shot of the user guide, section data-feed (2026-10-29, AdminCP of 7b13a85)

Sports, leagues, teams, players, events and contests are set up from the Fantasy Engine menu: that is the business side, covered by the user guide, not by this document.

Verification checklist#

Last updated: 2026-10-22 · v1.0.0

  1. API answers.
    curl -s -o /dev/null -w "%{http_code}\n" https://your-site.example/api/init
    curl -s https://your-site.example/api/init | head -c 120
    Expected
    200
    {"data":{"config":{"siteName":"Fantasy Engine",...
  2. The Authorization header reaches PHP. Log in through the API with the admin account and ask who you are:
    TOKEN=$(curl -s -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' \
      -d '{"email":"[email protected]","password":"a-strong-admin-password"}' \
      https://your-site.example/api/auth/login | php -r 'echo json_decode(stream_get_contents(STDIN))->data->token;')
    curl -s -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' https://your-site.example/api/user/me | head -c 60
    Expected: id 1 (id 0 = the header was dropped on the way)
    {"data":{"id":1,...
  3. AdminCP. https://your-site.example/admin → login → dashboard; the footer shows Current Version: 1.0.0.
  4. Web app. https://your-site.example/ shows the app (never "The web app has not been built"); sign up a test member and log in.
  5. Installer closed. https://your-site.example/install/requirements answers 404.
  6. Scheduler. Within five minutes of adding cron, AdminCP → Tasks shows Succeeded: last on ....
  7. Environment.
    php artisan about --only=environment
    Expected
      Environment ..................... production
      Debug Mode ............................ OFF
      URL ............................ your-site.example
  8. Versions. SELECT name, version FROM packages; shows the content of public/version.txt on every row.

Every step run against the two test installs on 2026-10-22 (artisan serve and Apache): /api/init 200, me id 1 with the header and 0 without, /admin 302, dashboard 200, /install/requirements 404.

Troubleshooting#

Last updated: 2026-11-19 · v1.0.0

SymptomCause and fix
The installer's requirement page shows a red mark beside a PHP extension and no Set Environment buttonthat extension is not loaded by PHP: install it (for example apt install php8.3-xml php8.3-mbstring php8.3-zip php8.3-gd php8.3-curl php8.3-mysql), restart PHP-FPM and reload the page. The list is the set the shipped vendor/ needs (PHP), so a site that passes it does not fail later for a missing extension.
HTTP 500 on every page right after unpackingPHP below 8.3, a missing extension, or storage/ / bootstrap/cache/ not writable. Read storage/logs/ and the PHP-FPM log.
"Unable to save the .env file. Please create it manually."the project root is not writable by PHP during the web install: fix the owner, or use the command-line install.
The installer shows an error after Installthe migration log is on the page and .env was removed. Fix the cause, drop and recreate the database (a half-migrated schema cannot be resumed) and start again.
Web or app login: "Something went wrong!"the Authorization header does not reach PHP (custom proxy / FastCGI). Run the curl test of the Verification checklist.
/admin answers 403 on nginxadd the location = /admin block (nginx).
The AdminCP address answers 404check APP_ADMIN_PREFIX; an unknown address under the prefix is a 404 on purpose.
The site loads without styles / scriptsthe AdminCP Site url does not match the address (assets are built from it), or the web build is missing from public/_expo.
A site in a sub-folder stays on the logo, or its links lead to the domain rootthe web app still holds another base path (an edited .env / database, a moved folder): open any page once (the site repairs it itself when public/_expo is writable) or run php artisan shaun_core:web_base; read storage/logs/ for "Web base path not written".
"The web app has not been built"public/_expo/static/js/web holds no entry bundle (entry-<hash>.js; the page loads only the start bundles, the other files there are screens the app loads on demand): the standard package carries the build; from the git source run build_web.sh (Build the apps).
HTTP 500 on every address after enabling mod_expires (or on an Apache without mod_headers); the Apache error log says "ExpiresActive not allowed here"the mod_expires rules of public/.htaccess need Indexes in AllowOverride: use AllowOverride All or AllowOverride FileInfo Indexes Options=Indexes,MultiViews, or enable mod_headers (Apache, browser cache).
The admin login is [email protected] / adminshaun_core:install ran without its arguments: change the e-mail and password in AdminCP → Users at once.
Contests never go live or completeno cron (AdminCP → Tasks says "No, cron job configuration is not correct."). A contest of a fed league that shows "Results pending review" is waiting for its league's settle delay: that is normal.
A fed league gets no fixtures or resultsopen Fantasy Engine → Data Feed: a red notice "The data feed refused the api key (HTTP 401/403) ..." = save a valid key (requests pause 10 minutes after a refusal, saving a key ends the pause); "The api url ... is not an https address" = fix Api url; "The TLS certificate ... is not verified" = the check was switched off; "The last n requests ... failed" with timeout = the server cannot reach the feed (outgoing HTTPS, CA bundle). the tab Last requests lists each call with its HTTP status (filter by outcome). A failed schedule read is retried every hour at :50; the teams and players crawls run again the next night.
Data Feed → Overview shows a red card "Contests still live (n)", or Manage Contests a red noticelive contests of fed leagues whose games all finished more than the settle delay + 30 minutes ago: the scheduler is not running (check cron and the Tasks page) or a result is stuck. Check their results, then complete or cancel them in Manage Contests (Show them).
Sync data answers "Not synced: <league> (the error is in the log of the site)."that league could not be prepared (the others were synced): read storage/logs/ and send the error to support.
Members get "Creating contests is turned off on this site." or a limit messagethe member contest settings (General Configuration → Fantasy Engine): switch Members can create contests on or raise / zero the two limits.
No e-mail arrivesMail → Troubleshooting.
HTTP 500 on every page after a command-line install, log "No application encryption key has been specified."APP_KEY is empty: run php artisan key:generate --force.
Where are the logs?storage/logs/shaun-error-YYYY-MM.log (errors), shaun-mail-YYYY-MM.log (mail), laravel.log; also AdminCP → System Setting → System Log.

Local development addresses#

Last updated: 2026-11-19 · v1.0.0

Local ports

The developers run the product on http://127.0.0.1:8090 (Reverb 6060, Metro 8081), with php artisan serve. These ports are local only; a server uses 443 for the site.

Change log#

Last updated: 2026-11-19 · v1.0.0

Date (GMT+7)SectionWhat changed
2026-10-22allFirst version, checked against daily-fantasy c68e20c; the install paths verified on test installs.
2026-10-22env-keys, install-wizard, install-cli, troubleshooting.env_example ships an empty APP_KEY and config/app.php has no fallback key (the installer pages use a temporary per-copy key until .env exists); the web installer writes PUSHER_APP_* for Reverb: the "add the Reverb keys" warning removed; the mail TLS remark removed; both install paths re-run on the 9c4fba6.
2026-10-23permissions, install-wizard, troubleshootingOne package installs at a domain root or in any sub-folder (the site writes its base path into public/_expo: install, Site url change, update, shaun_core:web_base); public/_expo writable for a sub-folder site; root-level zip layout; a troubleshooting row. Verified with a full zip under Apache 2.4.58 in a sub-folder and at a root.
2026-10-23what-you-install, unpackThe Fantasy Engine zips hold the files at the archive root (no fantasyengine-<version>/ top folder): new unpack command; build_release.ps1 (Windows) beside build_release.sh, both checked to give the same entries; sizes re-measured.
2026-10-28overview-ways, install-cli77 tables and 85 migrations for 1.0.0 (the data-feed request log and the late-correction / re-settle tables are part of 1.0.0).
2026-10-28overview-parts, req-webThe data feed as an optional part; outgoing HTTPS with a CA bundle (the site verifies the feed's certificate and sends nothing to an http address).
2026-10-28cron, cron-tasks19 scheduled entries: feed_prune (03:40) added; the new stats cadence of crawl_stats; settle delay and re-settle top-ups in check_live; Tasks page re-shot.
2026-10-28first-settings, troubleshootingThe api key moved from the settings card to Fantasy Engine → Data Feed (masked, TLS switch); settle delay per league; Fantasy Engine card re-shot, Data Feed shot added; a row for a fed league without results.
2026-10-28overview-packages, unpack, permissions, install-wizardRe-checked against daily-fantasy 35188bf; the dates of unpack and permissions unchanged.
2026-10-28install-wizard, overview-packagesThe wizard note gives today's 77 tables / 85 migrations; package sizes of the 7b8ff49 build (the same as build-apps).
2026-10-28cron-tasksCrawl_stats - every 30 minutes after the play window, given up at 48 h (MLB 96 ...), then only every 6 hours for a live contest.
2026-10-28first-settings, first-loginThe Data Feed shot re-taken at d2d8b13 (no Active / Inactive buttons); shots named after their section: first-login__dashboard, first-settings__fantasy-engine-settings (shared with build-apps and the user guide); the Data Feed shot keeps the user-guide name data-feed__feed-screen (shared).
2026-10-28install-wizardSite Settings ("Site Info" in the step bar): the time zone field is preset to London (checked by an install from the 1.0.0 sale zip through the wizard).
2026-10-29overview-ways, install-cli90 migrations (five more 1.0.0 migrations), 77 tables, checked against the 94fe444.
2026-10-29cron, cron-tasks, queueschedule:list has 20 entries (new hourly crawl_schedule --due); overlap lock minutes per command and the expiring job locks (what a killed process costs); lighter stats polling (fixtures nobody plays, 45-second turns, 10-second timeouts); auto contests skip inactive events and game types a league does not offer; queue row of the Data Feed screen. Tasks page re-shot.
2026-10-29first-settings, troubleshootingThree member contest settings; the Data Feed screen in tabs (Overview shot replaces data-feed__feed-screen, settings card re-shot); rows for "Contests still live", "Not synced: ..." and the member contest refusals; failed schedule reads retried hourly.
2026-10-29first-settingsRow for the optional Fantasy Engine → Landing Page backgrounds (7b13a85); the Data Feed overview shot re-taken with the whole AdminCP shell.
2026-10-29first-settingsThe Fantasy Engine → Landing Page row is gone: the landing background upload was removed (the landing page has one look and nothing to set).
2026-10-29troubleshootingThe wizard message quoted as the installer now prints it: "Unable to save the .env file. Please create it manually."
2026-10-30req-php, install-wizard, troubleshootingThe installer's requirement page checks every PHP extension the shipped vendor/ needs (25, pdo_mysql included, under "PHP extensions"): the Extensions text and a troubleshooting row for a red mark; Step 1 re-shot (install-wizard__requirements, 2026-10-30, from a test copy of 5daa011).
2026-10-30install-wizard, install-cliThe last step of the web installer and shaun_core:install delete storage/framework/install_key.
2026-10-30overview-ways, install-cli91 migrations (the flexible lineup slot migration of 2026-10-29), checked against the test database and the dev site.
2026-10-30env-keysNew row FIREBASE_CREDENTIALS: the site pushes with the key file it names (default firebase.json); no other key was added since 9c4fba6.
2026-10-30first-settings, troubleshootingRe-checked against daily-fantasy 5daa011, which holds the changes of 2026-10-29; no change of content besides the new row.
2026-11-02cron-tasks, cron-dbmodel:prune every 5 minutes with a 60-minute overlap lock and at most 500 rows of each kind per run; the overlap locks of every entry hold with APP_DEBUG=true too (callout, what a site with its own config/cache.php should know); schedule:run itself gets a 30 s read and 10 s connection limit (row scheduler).
2026-11-02cron-db (new)Database limits of the scheduled commands: every scheduled command (the package's, core's and the wallet's; config command_db) 30 s lock waits and MariaDB statements, 45 s read, 10 s connect; the scheduled queue worker 30 s lock waits and 90 s read; check_live and crawl_stats in the foreground before the worker. Nothing to set.
2026-11-03web-server-project-root (new), unpackThe root .htaccess (project folder or sub-folder as the document root) now serves only the files of public/: hidden paths 403, files outside public/ never served or run, every page through server.php, ACME tokens kept, 404 for everything without mod_rewrite. New section with the request table and a curl check; the unpack callout points to it. Checked on Apache 2.4.58 against daily-fantasy 49878b6 (the root .htaccess).
2026-11-04permissions, web-server-project-root, change logExample sub-folder path written as https://host/sub-folder; no other change (sections not re-checked, dates kept).
2026-11-05env-keys, first-settings, overview-waysThe in-app purchase store credentials are AdminCP settings, never .env keys or a key file (new "not used" row); first settings: Billings → Manage Payment Gateways with the two gateways PayPal and Stripe (the other seven were removed), and the in-app purchase fields of Mobile Application → General Configuration stay empty (switched off in 1.0.0). Counts re-checked on 5e767e8 (overview-ways): 91 migration files (the unique index of wallet_orders sits in its 1.0.0 migration), 20 entries of schedule:list: unchanged.
2026-11-16env-keys, install-cli, change-logChecked against 3e10186: php artisan optimize is recommended on a production server after the install and every update (every .env value is now read through the configuration, so a cached site keeps them); php artisan optimize:clear before editing .env; new step 6 of the command-line install with its expected output. A 1.0.0 site whose files are older than 2026-11-16 is not cached until it is updated.
2026-11-16overview-packagesPackage figures of the 1.0.0 packages rebuilt on 2026-11-16 (standard 37.1 MB / 20,964 files, full 44.1 MB / 21,700 files); the 1.0.0 packages carry the fixes of 1.0.0 without a new version number.
2026-11-16all, change-logThis copy of the guide describes version 1.0.0 (a separate copy describes 1.1.0). Internal labels, file names and the name of the test database taken out of older rows and "checked" lines; wording only, those Last updated lines stay.
2026-11-18env-keys, change-logChecked against 2aeee4b. New keys TRUSTED_PROXIES and TRUSTED_PROXY_HEADER: only a listed proxy may name the visitor's address, through one header; every per-visitor limit (member login, password-reset mails and codes, contact form, access code, requests of visitors not signed in) counts on it; behind Cloudflare its IP ranges with cf-connecting-ip; * lets any caller name its own address. APP_KEY also makes the mark of the PayPal / Stripe payments: one key per site sharing a gateway account. CACHE_DRIVER: the cache keeps the limit counts, so it must be shared and lasting (Files on one server, Redis or Memcached on several); Clear cache and an update reset the counts.
2026-11-18env-keys, change-logChecked against 676e702. TRUSTED_PROXIES: the AdminCP login brake and the social sign-in address (60 requests a minute) also count on the visitor address; without the key all visitors share 60 social sign-in requests a minute and one guesser can lock an admin account for everybody; 1.0.0 does not recognise a local proxy (nginx, load balancer) by itself, so the key is needed behind any proxy.
2026-11-19web-server-project-root, change-logChecked against 3bf3581 (the root .htaccess unchanged since 49878b6). Check after the upload: two more lines, /storage/logs/ and /vendor/autoload.php, which answer 404 or the HTML of the web app and never a folder list or a file's contents; what the site answers for an address that is no file of public/ (the app's "not found" page with status 200, 404 for a missing web asset); a log file name answers the same way; if one shows contents or a list, check AllowOverride and mod_rewrite, or set the document root to public/.
2026-11-19req-php, req-web, web-server-apache, web-server-project-root, web-server-nginx, env-keys, troubleshooting, change-logChecked against c0645f6. PHP settings: OPcache rows (opcache.enable=1 required, memory_consumption 256, max_accelerated_files 32531 for nearly 20,000 PHP files, validate_timestamps, realpath_cache_size 4096K) and a box on why, the Docker image and the check. Web server: mod_headers recommended or at least mod_expires; with mod_expires and without mod_headers a narrow AllowOverride must include Indexes, else every file answers 500; the same correction in the project-folder section. Apache: the cache lifetimes are no longer one year for every file: hashed build files 1 year immutable, other images / styles / scripts / fonts 7 days, service workers no-cache (table, curl check, a CDN should keep the origin's headers; the AdminCP scripts carry the cache number). nginx: three matching cache blocks (not run). .env keys: with cf-connecting-ip / x-real-ip the proxy's https, host and port still apply, overwrite X-Forwarded-Host / -Port at the proxy; the IP ban uses the same address. Troubleshooting: "The web app has not been built" means no entry-*.js; a row for the 500 of mod_expires.
2026-11-19allMoved to the documentation site: this page holds the sections overview-packages, overview-ways, overview-parts, req-php, req-db, req-web, unpack, permissions, env-keys, install-wizard, install-cli, web-server-apache, web-server-project-root, web-server-nginx, web-server-https, cron, cron-tasks, cron-db, queue, first-login, first-settings, verify-checklist, troubleshooting, local-ports of the former Install document. Page frame, headings and links between the pages updated; the text of the sections is unchanged.
2026-11-19install-snake, cron-tasks, local-portsThis guide describes Fantasy Engine only: the section install-snake removed; the snake draft notes taken out of cron-tasks, local-ports (the snake draft product has its own documents).
2026-11-19env-keys, install-cli, install-wizard, overview-parts, overview-ways, req-php, req-web, troubleshooting, unpack, web-server-nginxReferences to the tabs of the former single-page document replaced by links to the sections they meant; wording only.