Skip to content

When run migrate:fresh half way break, settings table not migrated, then prompt settings error for every command #23

Answered by rubenvanassche
shiroamada asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @shiroamada,

This is a limitation from the package at the moment, we've got the same problem in our own project for which this package was developed. Since Laravel registers all the dependencies at the boot process of your application the settings classes are loaded too. Which means theses classes will try to fetch the settings from database, when that database is not yet migrated the settings class will crash because it cannot find the correct properties.

At the moment there are two solutions to this:

  1. Use resolve(YourSettingsClass::class) in the places where Laravel automatically autoloads the settings
  2. Add the fields manually to your database so it's always in the correct state

I'm …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@shiroamada
Comment options

Answer selected by shiroamada
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants