Skip to content

Install Command #104

Description

@jbrooksuk

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.

Activity

  1. added this to the v3.0 milestone on Oct 11, 2024
  2. AlexJump24 commented on Oct 12, 2024

    @AlexJump24
    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 😄

  3. jbrooksuk commented on Oct 12, 2024

    @jbrooksuk
    MemberAuthor

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

  4. AlexJump24 commented on Oct 13, 2024

    @AlexJump24
    Contributor

    Awesome, sounds good to me!

  5. linked a pull request that will close this issue[WIP] Create Install Command #118on Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions