{"id":17148656,"url":"https://github.com/lcharette/uf_configmanager","last_synced_at":"2025-04-13T09:32:56.770Z","repository":{"id":57013027,"uuid":"76127967","full_name":"lcharette/UF_ConfigManager","owner":"lcharette","description":"Configuration Manager for UserFrosting V4","archived":false,"fork":false,"pushed_at":"2024-06-06T01:01:46.000Z","size":720,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"4.1","last_synced_at":"2024-10-31T19:51:35.706Z","etag":null,"topics":["userfrosting","userfrosting-sprinkle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lcharette.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"lcharette","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-12-10T17:43:53.000Z","updated_at":"2024-06-06T01:01:49.000Z","dependencies_parsed_at":"2024-01-12T06:54:29.138Z","dependency_job_id":"45e51f49-4d05-47ea-802e-d88087c1bb1d","html_url":"https://github.com/lcharette/UF_ConfigManager","commit_stats":{"total_commits":82,"total_committers":2,"mean_commits":41.0,"dds":"0.14634146341463417","last_synced_commit":"f7268558d6d97f7c039aba65c93dd1b2565c92cb"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_ConfigManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_ConfigManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_ConfigManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_ConfigManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lcharette","download_url":"https://codeload.github.com/lcharette/UF_ConfigManager/tar.gz/refs/heads/4.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223581935,"owners_count":17168655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["userfrosting","userfrosting-sprinkle"],"created_at":"2024-10-14T21:29:26.230Z","updated_at":"2024-11-07T20:05:12.662Z","avatar_url":"https://github.com/lcharette.png","language":"PHP","funding_links":["https://ko-fi.com/lcharette","https://ko-fi.com/A7052ICP"],"categories":[],"sub_categories":[],"readme":"# Configuration Manager Sprinkle for [UserFrosting 5](https://www.userfrosting.com)\n\n[![Donate][kofi-badge]][kofi]\n[![Latest Version][releases-badge]][releases]\n[![UserFrosting Version][uf-version]][uf]\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)\n[![Build][build-badge]][build]\n[![PHPStan][PHPStan-img]][PHPStan]\n[![Codecov][codecov-badge]][codecov]\n[![StyleCI][styleci-badge]][styleci]\n\n[kofi]: https://ko-fi.com/A7052ICP\n[kofi-badge]: https://img.shields.io/badge/Donate-Buy%20Me%20a%20Coffee-blue?logo=ko-fi\u0026logoColor=white\n[releases]: https://github.com/lcharette/UF_ConfigManager/releases\n[releases-badge]: https://img.shields.io/github/release/lcharette/UF_ConfigManager.svg?include_prereleases\u0026sort=semver\n[uf-version]: https://img.shields.io/badge/UserFrosting-\u003e=%205.0-brightgreen.svg\n[uf]: https://github.com/userfrosting/UserFrosting\n[build]: https://github.com/lcharette/UF_ConfigManager/actions?query=workflow%3ABuild\n[build-badge]: https://img.shields.io/github/actions/workflow/status/lcharette/UF_ConfigManager/Build.yml?branch=5.0\u0026logo=github\n[codecov]: https://codecov.io/gh/lcharette/UF_ConfigManager\n[codecov-badge]: https://codecov.io/gh/lcharette/UF_ConfigManager/branch/5.0/graph/badge.svg\n[styleci]: https://styleci.io/repos/76127967\n[styleci-badge]: https://styleci.io/repos/76127967/shield?branch=5.0\u0026style=flat\n[PHPStan-img]: https://img.shields.io/github/actions/workflow/status/lcharette/UF_ConfigManager/PHPStan.yml?branch=5.0\u0026label=PHPStan\n[PHPStan]: https://github.com/lcharette/UF_ConfigManager/actions/workflows/PHPStan.yml\n\nConfiguration Manager sprinkle for [UserFrosting 5](https://www.userfrosting.com). Lets you edit UserFrosting configs from the interface.\n\n# Help and Contributing\n\nIf you need help using this sprinkle or found any bug, feels free to open an issue or submit a pull request. You can also find me on the [UserFrosting Chat](https://chat.userfrosting.com/) most of the time for direct support.\n\n# Installation\nTo install in your Sprinkle : \n1. Add this package with Composer : \n   ```\n   composer require lcharette/uf_configmanager \"~4.1.0\"\n   ```\n\n2. Edit your Sprinkle Recipe to include the ConfigManager as a Sprinkle dependency :\n   ```\n   \\UserFrosting\\Sprinkle\\ConfigManager\\ConfigManager::class\n   ```\n\n3. Add Config Manager frontend assets dependencies : \n   ```\n   npm i --save @lcharette/configmanager@~4.1.0\n   ```\n\n4. Add Config Manager \u0026 FormGenerator frontend entries to your webpack entries. Open `webpack.config.js` and add in `const sprinkles { ... }`: \n   ```\n   FormGenerator: require('@lcharette/formgenerator/webpack.entries'),\n   ConfigManager: require('@lcharette/configmanager/webpack.entries'),\n   ```\n\n5. Run :\n   ```\n   php bakery bake\n   ```\n\n# Working example\n\nThe `public/` directory serves as an example of ConfigManager. You can clone this repository and install as any UserFrosting 5 sprinkle :\n1. `composer install`\n2. `php bakery bake`\n3. `php -S localhost:8080 -t public`\n\n## Permissions\nThe migration will automatically add the `update_site_config` permission to the `Site Administrator` role. If it's not added automatically, you can run the `UserFrosting\\Sprinkle\\ConfigManager\\Database\\Seeds\\SettingsPermissions` seed using the `php bakery seed` command or add it manually in the admin UI. To give access to the config UI to another user, simply add the `update_site_config` permission slug to that user role.\n\n## Add link to the menu\nThe configuration UI is bound to the the `/settings` route. Simply add a link to this route where you want it. The checkAccess make it so it will appear only for users having the appropriate permission. For example, you can add the following to the sidebar menu :\n\n```html\n{% if checkAccess('update_site_config') %}\n\u003cli\u003e\n    \u003ca href=\"{{site.uri.public}}/settings\"\u003e\u003ci class=\"fa fa-gears fa-fw\"\u003e\u003c/i\u003e \u003cspan\u003e{{ translate(\"CONFIG_MANAGER.TITLE\") }}\u003c/span\u003e\u003c/a\u003e\n\u003c/li\u003e\n{% endif %}\n```\n\n## Adding custom config\n\nSettings are separated by _topics_ in the UI. Each topic is represented by a file, located in `schema/config/`. Unlike normal schema files, all entries needs to be wrapped inside a `config` key. A `name` and `desc` top-level entry will allow to define the title and description of the topic.\n\n```json\n{\n    \"name\" : \"SITE.CONFIG\",\n    \"desc\" : \"SITE.CONFIG.DESC\",\n\n    \"config\": { ... }\n}\n```\n\nFor example, to add an entry for `site.title` text and `site.registration.enabled` checkbox option in a \"UserFrosting Settings\" topic :\n\n```json\n{\n    \"name\" : \"SITE.CONFIG\",\n    \"desc\" : \"SITE.CONFIG.DESC\",\n\n    \"config\": {\n        \"site.title\" : {\n            \"validators\" : {\n                \"required\" : {\n                    \"message\" : \"SITE.TITLE.REQUIRED\"\n                }\n            },\n            \"form\" : {\n                \"type\" : \"text\",\n                \"label\" : \"SITE.TITLE\",\n                \"icon\" : \"fa-comment\"\n            }\n        },\n        \"site.registration.enabled\" : {\n            \"validators\" : {},\n            \"form\" : {\n                \"type\" : \"checkbox\",\n                \"label\" : \"SITE.REGISTRATION.ENABLED\"\n            }\n        }\n    }\n}\n```\n\n\u003e *NOTE* Only `.json` are accepted. `Yaml` schemas are cannot be used for now.\n\n# License\n\nBy [Louis Charette](https://github.com/lcharette). Copyright (c) 2020, free to use in personal and commercial software as per the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcharette%2Fuf_configmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcharette%2Fuf_configmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcharette%2Fuf_configmanager/lists"}