{"id":17922697,"url":"https://github.com/overtrue/laravel-options","last_synced_at":"2025-10-16T20:32:03.883Z","repository":{"id":46078553,"uuid":"177929671","full_name":"overtrue/laravel-options","owner":"overtrue","description":"Global options module for Laravel application.","archived":false,"fork":false,"pushed_at":"2024-08-02T21:55:23.000Z","size":47,"stargazers_count":52,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T01:11:23.677Z","etag":null,"topics":["laravel-options","options","settings"],"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/overtrue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["overtrue"]}},"created_at":"2019-03-27T06:12:38.000Z","updated_at":"2024-09-03T02:15:49.000Z","dependencies_parsed_at":"2024-02-17T06:31:43.388Z","dependency_job_id":"94e9f945-6958-442c-905d-584f36e5ead3","html_url":"https://github.com/overtrue/laravel-options","commit_stats":{"total_commits":26,"total_committers":5,"mean_commits":5.2,"dds":0.3076923076923077,"last_synced_commit":"5725de7c21a84d3a9b9c3edede7b6c57d12909e7"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overtrue","download_url":"https://codeload.github.com/overtrue/laravel-options/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236745690,"owners_count":19198060,"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":["laravel-options","options","settings"],"created_at":"2024-10-28T20:40:29.478Z","updated_at":"2025-10-16T20:31:58.511Z","avatar_url":"https://github.com/overtrue.png","language":"PHP","funding_links":["https://github.com/sponsors/overtrue"],"categories":[],"sub_categories":[],"readme":"# Laravel Options\n\nGlobal options module for Laravel application.\n\n![Laravel Octane Ready Status](https://img.shields.io/badge/Octance-ready-green?style=flat-square)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/overtrue/laravel-options?style=flat-square)\n![GitHub License](https://img.shields.io/github/license/overtrue/laravel-options?style=flat-square)\n![Packagist Downloads](https://img.shields.io/packagist/dt/overtrue/laravel-options?style=flat-square)\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require overtrue/laravel-options\n```\n\n### Publish configuration and migrations\n\n```bash\n$ php artisan vendor:publish --provider=\"Overtrue\\LaravelOptions\\OptionsServiceProvider\"\n```\n\n### Run migrations\n\n```bash\n$ php artisan migrate\n```\n\n## Usage\n\n```php\n// set\n\\Option::set('foo', 'bar');\n\\Option::set(['foo' =\u003e 'bar', 'bar' =\u003e 'baz']);\n\n// get\n\\Option::get('foo'); // bar\n\\Option::get(['foo', 'bar']); // ['foo' =\u003e 'bar', 'bar' =\u003e 'baz']\n\\Option::all(['foo', 'bar']); // ['foo' =\u003e 'bar', 'bar' =\u003e 'baz']\n\n// get all\n\\Option::get();\n// or\n\\Option::all();\n\n// check exists\n\\Option::has('foo'); // true\n\n\\Option::remove('foo');\n\\Option::remove(['foo', 'bar']);\n```\n\n### Console commands\n\nIt is also possible to set options within the console:\n\n```bash\nphp artisan option:set {key} {value}\n```\n\n### Events\n\n-   `\\Overtrue\\LaravelOptions\\Events\\OptionCreated::class`\n-   `\\Overtrue\\LaravelOptions\\Events\\OptionUpdated::class`\n-   `\\Overtrue\\LaravelOptions\\Events\\OptionSaved::class`\n-   `\\Overtrue\\LaravelOptions\\Events\\OptionDeleted::class`\n-   `\\Overtrue\\LaravelOptions\\Events\\OptionRetrieved::class`\n-   `\\Overtrue\\LaravelOptions\\Events\\Event::class`\n\n## Testing\n\n```bash\n$ composer test\n```\n\n## :heart: Sponsor me\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n如果你喜欢我的项目并想支持它，[点击这里 :heart:](https://github.com/sponsors/overtrue)\n\n## Project supported by JetBrains\n\nMany thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.\n\n[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/overtrue)\n\n## Contributing\n\nYou can contribute in one of three ways:\n\n1. File bug reports using the [issue tracker](https://github.com/overtrue/laravel-options/issues).\n2. Answer questions or fix bugs on the [issue tracker](https://github.com/overtrue/laravel-options/issues).\n3. Contribute new features or update the wiki.\n\n_The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable._\n\n## PHP 扩展包开发\n\n\u003e 想知道如何从零开始构建 PHP 扩展包？\n\u003e\n\u003e 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovertrue%2Flaravel-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-options/lists"}