[phases.setup]
nixPkgs = [
  "php84",
  "php84Extensions.pdo",
  "php84Extensions.pdo_pgsql",
  "php84Extensions.mbstring",
  "php84Extensions.xml",
  "php84Extensions.curl",
  "php84Extensions.zip",
  "php84Extensions.gd",
  "php84Extensions.tokenizer",
  "php84Extensions.fileinfo",
  "php84Extensions.openssl",
  "nodejs_22"
]

[phases.install]
cmds = [
  "curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && php /usr/local/bin/composer install --no-dev --optimize-autoloader --no-interaction",
  "npm ci"
]

[phases.build]
cmds = [
  "php artisan wayfinder:generate",
  "npm run build",
  "php artisan config:cache",
  "php artisan route:cache",
  "php artisan view:cache"
]

[start]
cmd = "php artisan migrate --force && php artisan serve --host=0.0.0.0 --port=$PORT"
