question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why is Backpack trying to query the database on route:list command ?

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
promatikcommented, Feb 25, 2021

@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 😅

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.

This is probably the way 👌

0reactions
pxpmcommented, Feb 25, 2021

We don’t select any user, we just instantiate the User model to get the table name, and check if that table contains the email 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Operations :: 5.x Docs - Backpack for Laravel
List - allows the admin to see all entries for a model, with pagination, ... If you want to add a new route...
Read more >
Laravel Backpack CRUD not working - Stack Overflow
I want to make my answer very detailed, so that's why I've started it from the beginning. The version for backpack CRUD I...
Read more >
Importing a BACPAC file for a SQL database using SSMS
Specify export settings; Review the export summary; Check the result of the operation. Export Data-tier application wizard for BACPAC package.
Read more >
BackpackForLaravel/Lobby - Gitter
Thank you @DoDSoftware . But also i want to ask you a question about, if run the command of creating a controller with...
Read more >
Import a .bacpac file to create a database in Azure SQL ...
Specify the new database size (usually the same as origin) and provide the destination SQL Server credentials. For a list of possible values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found