Repository navigation
Turn Laravel Boost on only in the local environment - #574
Merged
Merged
Conversation
Boost enables itself wherever APP_DEBUG is true, so the development server, which installs dev packages and runs with debug on, injected Boost's browser logger and served its routes. The published config now defaults boost.enabled to APP_ENV=local; BOOST_ENABLED still overrides it.
4 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns Laravel Boost off everywhere except local.
Why
Development pages logged "Browser logger active (MCP server detected). Posting to: https://dev.biospex.org/_boost/browser-logs". Boost's own check turns it on when the environment is
localorAPP_DEBUGis true. Development installs dev packages (deploy/custom.phpskips--no-devthere, which is also how it gets Debugbar) and runs withAPP_DEBUG=true, so Boost injected its browser logger and registered its/_boost/...routes. Production was not affected:APP_DEBUG=false, and Boost isn't installed there.Change
config/boost.php(unchanged from the package) except'enabled' => env('BOOST_ENABLED', env('APP_ENV') === 'local'). Boost now runs only whereAPP_ENV=local; settingBOOST_ENABLEDstill overrides it.BOOST_setting in its environment, so it gets the new default.Tested locally
tests/Feature/BoostConfigTest.php:local→ on,developmentandproduction→ off, andBOOST_ENABLED=trueoverrides the default. 4 passed.php artisan config:show boost.enabledis stilltrue(APP_ENV=local), so the MCP tools keep working.To verify on development
See #573.