{"id":37232311,"url":"https://github.com/inmanturbo/features","last_synced_at":"2026-01-15T03:48:32.025Z","repository":{"id":314281502,"uuid":"1054878355","full_name":"inmanturbo/features","owner":"inmanturbo","description":"A pluggable feature system built on top of Laravel Pennant","archived":false,"fork":false,"pushed_at":"2025-09-22T10:06:57.000Z","size":597,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-29T00:56:18.259Z","etag":null,"topics":["hackathon","vibe-coding"],"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/inmanturbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T13:04:32.000Z","updated_at":"2025-09-21T17:18:44.000Z","dependencies_parsed_at":"2025-09-11T16:27:11.172Z","dependency_job_id":"47488cce-41ef-4454-a158-73ef42a51fa5","html_url":"https://github.com/inmanturbo/features","commit_stats":null,"previous_names":["inmanturbo/features"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/inmanturbo/features","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inmanturbo%2Ffeatures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inmanturbo%2Ffeatures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inmanturbo%2Ffeatures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inmanturbo%2Ffeatures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inmanturbo","download_url":"https://codeload.github.com/inmanturbo/features/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inmanturbo%2Ffeatures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["hackathon","vibe-coding"],"created_at":"2026-01-15T03:48:31.530Z","updated_at":"2026-01-15T03:48:32.009Z","avatar_url":"https://github.com/inmanturbo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Features Package\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/inmanturbo/features.svg?style=flat-square)](https://packagist.org/packages/inmanturbo/features)\n[![Tests](https://img.shields.io/github/actions/workflow/status/inmanturbo/features/tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/inmanturbo/features/actions/workflows/tests.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/inmanturbo/features.svg?style=flat-square)](https://packagist.org/packages/inmanturbo/features)\n[![License](https://img.shields.io/github/license/inmanturbo/features.svg?style=flat-square)](https://github.com/inmanturbo/features/blob/main/LICENSE)\n\nA pluggable feature system built on top of [Laravel Pennant](https://github.com/laravel/pennant).\n\n## Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require inmanturbo/features\n```\n\nThe service provider will be automatically registered thanks to Laravel's package auto-discovery.\n\n## Configuration\n\n### Defined-Database Driver\n\nThis package uses a custom `defined-database` driver that only retrieves features that have been explicitly defined. This allows removing features without losing any data, fetures can be redefined later with their data still intact.\n\nThe published Pennant config sets this as the default driver:\n\n```php\n'default' =\u003e env('PENNANT_DRIVER', 'defined-database'),\n```\n\n## Usage\n\n### Before Hooks\n\n```php\nuse Laravel\\Pennant\\Feature;\n\nFeature::before('new-api', function (User $user) {\n  if (Config::get('features.new-api.disabled')) {\n      return $user-\u003eisInternalTeamMember();\n  }\n});\n\n```\n\n### Resetting Feature Defaults\n\n#### Using the Artisan Command\n\nThe package provides a convenient `feature:reset` Artisan command to reset features interactively or via command line options.\n\n##### Interactive Mode\n\nRun the command without options for an interactive experience:\n\n```bash\nphp artisan feature:reset\n```\n\nWhen features exist in your database, the command will:\n1. **Auto-discover** available scopes and features from your database\n2. **Present interactive menus** to select:\n   - A specific scope or \"[All Scopes]\" \n   - A specific feature or \"[All Features]\"\n3. **Safely reset** only the selected combination\n\nIf no features exist in the database, it will immediately reset (no-op) without prompting.\n\n##### Command Line Options\n\nSkip the interactive prompts by providing explicit options:\n\n```bash\n# Reset all features for all scopes (when database is empty)\nphp artisan feature:reset\n\n# Reset all features for a specific scope\nphp artisan feature:reset --scope=\"user:1\"\n\n# Reset a specific feature for all scopes  \nphp artisan feature:reset --feature=\"new-dashboard\"\n\n# Reset a specific feature for a specific scope\nphp artisan feature:reset --scope=\"user:1\" --feature=\"new-dashboard\"\n\n# Reset non-existent features (safe no-op)\nphp artisan feature:reset --scope=\"nonexistent\" --feature=\"missing\"\n```\n\n##### Use Cases\n\nThe `feature:reset` command is useful for:\n\n- **Development**: Quickly reset feature flags during testing\n- **Debugging**: Remove problematic feature overrides to fall back to defaults  \n- **Data cleanup**: Clear old or unused feature flag data\n- **User management**: Reset features for specific users or teams\n- **Feature rollback**: Revert features to their default state after experiments\n\n#### Using the FeatureRegistry Class\n\nThe `FeatureRegistry` class provides a `resetDefaults` method to remove feature flags from the database, allowing them to fall back to their default values:\n\n```php\nuse Inmanturbo\\Features\\FeatureRegistry;\n\n// Reset all features for all scopes\nFeatureRegistry::resetDefaults();\n\n// Reset all features for a specific scope (user, team, etc.)\nFeatureRegistry::resetDefaults(scope: $user);\n\n// Reset a specific feature for all scopes\nFeatureRegistry::resetDefaults(name: 'feature-name');\n\n// Reset a specific feature for a specific scope\nFeatureRegistry::resetDefaults(scope: $user, name: 'feature-name');\n```\n\nThis is useful when you want to:\n\n- Remove overridden feature values and revert to defaults\n- Clean up test data\n- Reset features during development\n\n## Credits\n\nThis package is built on top of [Laravel Pennant](https://github.com/laravel/pennant), Laravel's official feature flag package.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finmanturbo%2Ffeatures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finmanturbo%2Ffeatures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finmanturbo%2Ffeatures/lists"}