{"id":25813743,"url":"https://github.com/macsidigital/laravel-setting","last_synced_at":"2026-04-14T02:31:31.109Z","repository":{"id":62521474,"uuid":"226495952","full_name":"MacsiDigital/laravel-setting","owner":"MacsiDigital","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-04T08:46:51.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-15T03:12:08.571Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","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/MacsiDigital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["MacsiDigital"]}},"created_at":"2019-12-07T10:53:25.000Z","updated_at":"2021-10-07T10:05:36.000Z","dependencies_parsed_at":"2022-11-02T14:00:39.562Z","dependency_job_id":null,"html_url":"https://github.com/MacsiDigital/laravel-setting","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacsiDigital%2Flaravel-setting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacsiDigital%2Flaravel-setting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacsiDigital%2Flaravel-setting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacsiDigital%2Flaravel-setting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MacsiDigital","download_url":"https://codeload.github.com/MacsiDigital/laravel-setting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241090719,"owners_count":19908005,"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":["hacktoberfest"],"created_at":"2025-02-28T02:49:47.340Z","updated_at":"2026-04-14T02:31:31.079Z","avatar_url":"https://github.com/MacsiDigital.png","language":"PHP","funding_links":["https://github.com/sponsors/MacsiDigital"],"categories":[],"sub_categories":[],"readme":"# Laravel Setting\n\n## Configs in the database\n\n![Header Image](https://github.com/MacsiDigital/repo-design/raw/master/laravel-setting/header.png)\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://github.com/MacsiDigital/laravel-setting/actions?query=workflow%3ATests\"\u003e\u003cimg src=\"https://github.com/MacsiDigital/laravel-setting/workflows/Tests/badge.svg\" style=\"max-width:100%;\"  alt=\"tests badge\"\u003e\u003c/a\u003e\n \u003ca href=\"https://packagist.org/packages/macsidigital/laravel-setting\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/macsidigital/laravel-setting.svg?style=flat-square\" alt=\"version badge\"/\u003e\u003c/a\u003e\n \u003ca href=\"https://packagist.org/packages/macsidigital/laravel-setting\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/macsidigital/laravel-setting.svg?style=flat-square\" alt=\"downloads badge\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA setting package to save settings to the db and access them through config.\n\n## Support us\n\nWe invest a lot in creating [open source packages](https://macsidigital.co.uk/open-source), and would be grateful for a [sponsor](https://github.com/sponsors/MacsiDigital) if you make money from your product that uses them.\n\n## Installation\n\nThis package can be used in Laravel 6.0 or higher.\n\nYou can install the package via composer:\n\n```bash\ncomposer require macsidigital/laravel-setting\n```\n\nYou must publish the migration with:\n\n``` bash\nphp artisan vendor:publish --tag=\"setting-migrations\"\n```\n\n## Usage\n\nYou can save groups and settings like so\n\n``` php\n$group = Group::create([\n    'identifier' =\u003e \"test\",\n    'name' =\u003e \"Test Settings\",\n    'description' =\u003e \"Test Settings and other things\"\n]);\n$item = Item::make(['key' =\u003e 'mailchimp', 'name' =\u003e 'Mailchimp Key', 'description' =\u003e 'Your Mailchimp API key so we can enable communication with your Mailchimp account']);\n$group-\u003eitems()-\u003esave($item);\n```\n\nAs we utilise Eloquent you can use any Eloquent functions.  For example, do the following to retrieve a setting group.\n\n``` php\nGroup::where('identifier', 'membership')-\u003efirst();\n```\n\nWe are linked to the items in the normal relationship way\n\n``` php\nforeach(Group::where('identifier', 'membership')-\u003efirst()-\u003eitems){\n\t// do something\n}\n```\n\n## Auto loading\n\nThere's an autoload field, which if set will automatically load the settings into config\n\n``` php\n$group = Group::create([\n    'identifier' =\u003e \"test\",\n    'name' =\u003e \"Test Settings\",\n    'description' =\u003e \"Test Settings and other things\",\n    'autoload' =\u003e true\n]);\n$item = Item::make(['key' =\u003e 'mailchimp.api', 'name' =\u003e 'Mailchimp Key', 'description' =\u003e 'Your Mailchimp API key so we can enable communication with your Mailchimp account', 'autoload' =\u003e true]);\n$group-\u003eitems()-\u003esave($item);\n\n// Access with\nconfig('test.mailchimp.api');\n```\n\nThis will be automatically loaded when the Setting Service Provider is booted.\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security-related issues, please email [info@macsi.co.uk](mailto:info@macsi.co.uk) instead of using the issue tracker.\n\n## Credits\n\n- [Colin Hall](https://github.com/colinhall17)\n- [MacsiDigital](https://github.com/MacsiDigital)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacsidigital%2Flaravel-setting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacsidigital%2Flaravel-setting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacsidigital%2Flaravel-setting/lists"}