ERROR There are no commands defined in the "boost" namespace.
Closed this issue · 7 comments
Laravel Package Version
1.0.21
Laravel Version
12.25.0
PHP Version
8.4.6
System Info
macos 15.6.1, running valet
Description
No matter what I try, removing reinstalling, cache, config clearing, the same error occurs when I try
php artisan boost:install
APP_ENV=local APP_DEBUG=true
Steps To Reproduce
install boost via composer
I am also got same issue. This error happened
php artisan boost:install
ERROR There are no commands defined in the "boost" namespace.Same, on Mac, using Herd.
same, on Mac
git:(main) ✗ php artisan boost:install
ERROR There are no commands defined in the "boost" namespace.
Update:
i forgot, i have set environment to production. it make the boost comand not defined. Now i can run php artisan boost:install.
Looks like there's been an update - you need to have BOOST_ENABLED=true in your .env.
Hey there, thanks for reporting this issue.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hello! This issue is typically caused by Laravel's environment detection. Boost includes safeguards to prevent it from running in production, and sometimes a local setup can be misidentified.
Here is a breakdown of the cause and the solution.
The Problem
The boost:* commands are unavailable because Laravel Boost will only run when the application environment is local or when APP_DEBUG is set to true. This is an intentional security feature to protect production environments.
The Cause
Your server configuration (Nginx, Apache, Docker, etc.) can set server-wide environment variables that override the values in your .env file. If APP_ENV=production is set at the server level, Laravel will ignore your local .env setting.
The Solution
You can resolve this with the following steps:
1. First, verify your current environment by running this command. It will show you what environment Laravel is actually using:
php artisan env2. If the output is production, choose one of the two solutions below:
A) Temporary Fix (For a single command)
Prefix the command with env APP_DEBUG=true to set the variable just for this one execution.
env APP_DEBUG=true php artisan boost:installB) Permanent Fix (For local development)
Ensure your .env file is configured for local development. This is the recommended approach for your development machine.
APP_ENV=local
APP_DEBUG=trueAfter applying the fix, the boost:install and boost:mcp commands will become available in your local environment.
Hope this helps!
@andy-laravel Haven’t heard back on this MR for a while, so I’m closing this issue as completed for now. If it still comes up, feel free to reach out and I’ll reopen it. Thanks!