Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Command #104

Open
jbrooksuk opened this issue Oct 9, 2024 · 3 comments · May be fixed by #118
Open

Install Command #104

jbrooksuk opened this issue Oct 9, 2024 · 3 comments · May be fixed by #118
Labels
Milestone

Comments

@jbrooksuk
Copy link
Member

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.

@jbrooksuk jbrooksuk added this to the v3.0 milestone Oct 11, 2024
@AlexJump24
Copy link
Contributor

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 😄

@jbrooksuk
Copy link
Member Author

Love this, @AlexJump24! What if the setting classes defined a method that returns an array of property names that are "installable"?

@AlexJump24
Copy link
Contributor

Awesome, sounds good to me!

@jbrooksuk jbrooksuk linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants