#!/usr/bin/env bash
set -euo pipefail

echo "== VTU Preflight =="

command -v php >/dev/null || { echo "PHP missing"; exit 1; }
command -v composer >/dev/null || { echo "Composer missing"; exit 1; }

php -v
composer --version

if [ -f artisan ]; then
  php artisan about || true
  php artisan route:list >/dev/null
  php artisan config:clear >/dev/null
else
  echo "Run this script from the Laravel project root after applying the overlay."
fi

echo "Preflight completed."
