Skip to content

Instantly share code, notes, and snippets.

@jpcaparas
Last active February 7, 2024 09:30
Show Gist options
  • Save jpcaparas/968ce722227ed5b306642827f11c64aa to your computer and use it in GitHub Desktop.
Save jpcaparas/968ce722227ed5b306642827f11c64aa to your computer and use it in GitHub Desktop.
Do not use file cache on Laravel's artisan:serve command

Step 1: Terminate the running web server

Step 2: Modify the .env directive CACHE_DRIVER to be array instead of file.

Step 3: Remove the cached bootstrap files by running php artisan optimize:clear

Step 4: Flush the application cache for good measure by running php artisan optimize:clear

Step 5: Run php artisan serve. Any real-time changes to your .env file should reflect immediately on the app rather than having to force a web server restart each time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment