#!/bin/bash # Post-install script for Laravel project # Run this after 'composer create-project laravel/laravel' # Usage: ./scripts/post-install.sh set -e echo "==========================================" echo "Laravel Post-Install Setup" echo "==========================================" # Check if we're in a Laravel project if [ ! -f "artisan" ]; then echo "Error: Not in a Laravel project directory" echo "Run this from your Laravel project root (src/)" exit 1 fi # Install Ignition (already included in Laravel, but ensure latest) echo "" echo "[1/5] Ensuring Ignition is installed..." composer require spatie/laravel-ignition --dev # Install Flare for production error tracking echo "" echo "[2/5] Installing Flare for production error tracking..." composer require spatie/laravel-flare # Install Telescope for development debugging (optional) echo "" read -p "Install Laravel Telescope for development debugging? [y/N]: " INSTALL_TELESCOPE if [[ "$INSTALL_TELESCOPE" =~ ^[Yy]$ ]]; then composer require laravel/telescope --dev php artisan telescope:install php artisan migrate echo "Telescope installed. Access at: /telescope" fi # Publish Flare config echo "" echo "[3/5] Publishing Flare configuration..." php artisan vendor:publish --tag=flare-config # Setup Laravel Pint (code style) echo "" echo "[4/5] Setting up Laravel Pint..." if [ -f "../src/pint.json" ]; then cp ../pint.json ./pint.json 2>/dev/null || true fi echo "Pint configured. Run: ./vendor/bin/pint" # Create custom error pages echo "" echo "[5/5] Creating custom error pages..." mkdir -p resources/views/errors # 500 Error Page cat > resources/views/errors/500.blade.php << 'EOF' Server Error

500

Something went wrong

We're sorry, but something unexpected happened. Our team has been notified and is working on it.

Go Home
EOF # 404 Error Page cat > resources/views/errors/404.blade.php << 'EOF' Page Not Found

404

Page not found

The page you're looking for doesn't exist or has been moved.

Go Home
EOF # 503 Maintenance Page cat > resources/views/errors/503.blade.php << 'EOF' Maintenance Mode
🔧

Be Right Back

We're doing some maintenance

We're making some improvements and will be back shortly. Thanks for your patience!

EOF echo "" echo "==========================================" echo "Post-install setup complete!" echo "==========================================" echo "" echo "Next steps:" echo " 1. Get your Flare key at: https://flareapp.io" echo " 2. Add FLARE_KEY to your .env file" echo " 3. Customize error pages in resources/views/errors/" echo "" echo "Ignition features (development):" echo " - AI error explanations" echo " - Click-to-open in VS Code" echo " - Runnable solution suggestions" echo "" if [[ "$INSTALL_TELESCOPE" =~ ^[Yy]$ ]]; then echo "Telescope dashboard: http://localhost:8080/telescope" echo "" fi