# Fix .env file - Run these commands one by one # 1. Create backup first cp .env .env.backup # 2. Check for syntax errors grep -n "^[^#].*[^=]$" .env | grep -v "=" | head -10 # 3. Fix APP_URL (remove any quotes or spaces) sed -i 's|^APP_URL=.*|APP_URL=https://phillip.stockmanage.store|' .env # 4. Fix ASSET_URL if grep -q "^ASSET_URL" .env; then sed -i 's|^ASSET_URL=.*|ASSET_URL=https://phillip.stockmanage.store|' .env else echo "ASSET_URL=https://phillip.stockmanage.store" >> .env fi # 5. Remove any trailing spaces from all lines sed -i 's/[[:space:]]*$//' .env # 6. Verify the fix grep "^APP_URL\|^ASSET_URL" .env # 7. Test if .env is valid now php -r "echo 'Testing .env...'; \$dotenv = Dotenv\Dotenv::createImmutable(__DIR__); \$dotenv->load(); echo 'OK';" 2>&1 || echo "Still has errors" # 8. Clear cache php artisan config:clear