{"id":13815887,"url":"https://github.com/appstract/laravel-options","last_synced_at":"2025-05-14T02:04:50.894Z","repository":{"id":41117559,"uuid":"83736189","full_name":"appstract/laravel-options","owner":"appstract","description":"Global key-value store in the database","archived":false,"fork":false,"pushed_at":"2025-04-03T20:02:59.000Z","size":88,"stargazers_count":730,"open_issues_count":0,"forks_count":67,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-11T14:16:55.755Z","etag":null,"topics":["database","key-value","laravel","laravel-package","options"],"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/appstract.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2017-03-02T23:41:37.000Z","updated_at":"2025-04-09T16:19:52.000Z","dependencies_parsed_at":"2024-01-17T07:59:57.952Z","dependency_job_id":"08bcd450-5230-490c-9dd4-1cf9e3c74c08","html_url":"https://github.com/appstract/laravel-options","commit_stats":{"total_commits":88,"total_committers":25,"mean_commits":3.52,"dds":0.7840909090909091,"last_synced_commit":"a8e6ab2d35f319d2fdd3388d37f7aa00292a7a95"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appstract%2Flaravel-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appstract%2Flaravel-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appstract%2Flaravel-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appstract%2Flaravel-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appstract","download_url":"https://codeload.github.com/appstract/laravel-options/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052669,"owners_count":22006716,"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":["database","key-value","laravel","laravel-package","options"],"created_at":"2024-08-04T05:00:17.866Z","updated_at":"2025-05-14T02:04:50.872Z","avatar_url":"https://github.com/appstract.png","language":"PHP","funding_links":["https://www.paypal.me/teamappstract/10","https://www.patreon.com/appstract"],"categories":["PHP","Uncategorized","Packages"],"sub_categories":["Uncategorized","Helpers/General"],"readme":"# Laravel Options\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/appstract/laravel-options.svg?style=flat-square)](https://packagist.org/packages/appstract/laravel-options)\n[![Total Downloads](https://img.shields.io/packagist/dt/appstract/laravel-options.svg?style=flat-square)](https://packagist.org/packages/appstract/laravel-options)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n\nGlobal key-value store in the database\n\n## Installation\n\nTo get started with laravel-options, use Composer to add the package to your project's dependencies:\n\n```bash\ncomposer require appstract/laravel-options\n```\n\n### Publish, migrate\n\nBy running `php artisan vendor:publish --provider=\"Appstract\\Options\\OptionsServiceProvider\"` in your project all files for this package will be published. For this package, it's only a migration. Run `php artisan migrate` to migrate the table. There will now be an `options` table in your database.\n\n## Usage\n\nWith the `option()` helper, we can get and set options:\n\n```php\n// Get option\noption('someKey');\n\n// Get option, with a default fallback value if the key doesn't exist\noption('someKey', 'Some default value if the key is not found');\n\n// Set option\noption(['someKey' =\u003e 'someValue']);\n\n// Remove option\noption()-\u003eremove('someKey');\n\n// Check the option exists\noption_exists('someKey');\n```\n\nIf you want to check if an option exists, you can use the facade:\n\n```php\nuse Option;\n\n$check = Option::exists('someKey');\n```\n\nThe helpers are available as Blade directives:\n```php\n@option('someKey')\n\n@option('someKey', 'Default value')\n\n@optionExists('someKey')\n    // Code\n@endif\n```\n\n### Console\n\nIt is also possible to set options within the console:\n\n```bash\nphp artisan option:set {someKey} {someValue}\n```\n\n## Testing\n\n```bash\n$ composer test\n```\n\n## Contributing\n\nContributions are welcome, [thanks to y'all](https://github.com/appstract/laravel-options/graphs/contributors) :)\n\n## About Appstract\n\nAppstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on [Medium](https://medium.com/appstract). You can [follow us on Twitter](https://twitter.com/teamappstract), [buy us a beer](https://www.paypal.me/teamappstract/10) or [support us on Patreon](https://www.patreon.com/appstract).\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%2Fappstract%2Flaravel-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappstract%2Flaravel-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappstract%2Flaravel-options/lists"}