#!/bin/bash
# Post-deployment cache optimization script
# Run after each deployment: bash scripts/deploy.sh

set -e

echo "==> Clearing old caches..."
php artisan optimize:clear

echo "==> Caching configuration..."
php artisan config:cache

echo "==> Caching routes..."
php artisan route:cache

echo "==> Caching views..."
php artisan view:cache

echo "==> Caching events..."
php artisan event:cache

echo "==> Done! All caches rebuilt."
