#!/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'
We're sorry, but something unexpected happened. Our team has been notified and is working on it.
Go HomeWe're making some improvements and will be back shortly. Thanks for your patience!