Why is Backpack trying to query the database on route:list command ?
See original GitHub issueBug report
What I did
Execute php artisan route:list
I use Homestead so normally I log on to that via homestead ssh, but sometimes I just execute simple commands from my terminal on my Mac. And when i run in the terminal, then I don’t have access to the mysql db, and therefore I get this error.
The big question is: why does backback need to access the db or why is this code executed… what else is going on ?
What I expected to happen
get a list of routes in my app
What happened
I found out that the for some reason backpack interact a little intrusive
in __construct on ResetPasswordController, this is called if (! backpack_users_have_email()) { abort(501, trans(‘backpack::base.no_email_column’)); }
But why does it get to that in the console ?
What I’ve already tried to fix it
??
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
PHP 8.0.0 (cli) (built: Nov 27 2020 12:26:05) ( NTS )
Copyright © The PHP Group
Zend Engine v4.0.0-dev, Copyright © Zend Technologies
with Zend OPcache v8.0.0, Copyright ©, by Zend Technologies
LARAVEL VERSION:
v8.29.0@d2eba352b3b3a3c515b18c5726b373fe5026733e
BACKPACK VERSION:
4.1.36@779364646e3b57258b981ff9f1bdcd9887143836
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
@pxpm I agree, I think that check is not necessary on console. Looking at this, I wonder why the check is being made directly on database and not on a config 😅
This is probably the way 👌
We don’t select any user, we just instantiate the
User
model to get the table name, and check if that table contains theemail
column.We would probably remove that in 4.2 because we introduced the
setup_password_recovery_routes
, so at this time, we can probably remove it, but it will be a breaking change.