Open jbrooksuk opened 1 month ago
I've been thinking of looking at this, had a few ideas to run by but don't want to overcomplicate things if not needed.
For the database settings I was thinking reflection could be used to get the properties off of AppSettings
. Then using Laravel Prompts the placeholder could be sourced off of the default value and the type of field used could be handled by a match statement based on the property type. E.g. confirm for boolean, select for enums, text for string etc...
Then maybe PHP Attributes could be used on the properties within the AppSettings
to set a description which could then be pulled out into the prompt. I thought this might be nice as its centralised and if you're adding a new setting you know to add the attribute. Again then the same reflection class can be used to pull the values through.
Then there are a few others bits that would need to thought about such as the App ID being autogenerated even though its on the object, again attributes could be used but then conscious of bloating the properties.
Alternatively they can just manually be put in the install command if wanting the full flexibility going forward 😄
Love this, @AlexJump24! What if the setting classes defined a method that returns an array of property names that are "installable"?
Awesome, sounds good to me!
It should be possible to configure Cachet via a
cachet:install
Artisan command.v2.x had an interactive command that would ask you questions and store the configuration.
For v3.x, this won't work exactly the same as we now have a mix of
.env
and database settings, but the idea is the same.