1️⃣ Install dependencies for production composer install --optimize-autoloader --no-dev Installs only production packages. Optimizes the autoloader for faster class loading. 2️⃣ Cache configuration and routes php artisan config:cache # caches all config files php artisan route:cache # caches all routes php artisan view:cache # caches all Blade templates config:cache → loads all config into one file (fast access) route:cache → pre-compiles all routes (faster routing) view:cache → pre-compiles Blade templates into PHP (faster view rendering) ⚠️ If you’re using closures in routes, route:cache will fail. Use controllers instead. 4️⃣ Clear old caches (optional but safe) php artisan cache:clear php artisan route:clear php artisan config:clear php artisan view:clear Clears old caches before rebuilding, avoids stale configs or routes. /* Current flow with Job-based timeout ✅ Flow Explanation 1. Send request to N nearest drivers createForDrivers() creates RideRequest rows and broadcasts new ride events. A timeout job is dispatched per driver. 2. Driver responds (Accept/Reject) Locks the RideRequest and RideTemp rows. If Accepted: ride confirmed, other requests rejected, next driver batch not sent. If Rejected: checks if all requests handled → sends next batch immediately. 3. Timeout Job Fires only if driver didn’t respond. Marks request as rejected. Checks if all requests handled → sends next batch or expires ride. 4. Next Batch & Expiry Always respects driver response timeout. Ensures no double assignment or race conditions using lockForUpdate(). */