{"id":15062756,"url":"https://github.com/clearlyip/laravel-flagsmith","last_synced_at":"2025-04-10T14:21:41.250Z","repository":{"id":56953580,"uuid":"409743774","full_name":"clearlyip/laravel-flagsmith","owner":"clearlyip","description":"A Flagsmith client for Laravel","archived":false,"fork":false,"pushed_at":"2025-03-21T07:39:22.000Z","size":59,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-03T04:31:23.331Z","etag":null,"topics":["composer","laravel","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clearlyip.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}},"created_at":"2021-09-23T21:06:25.000Z","updated_at":"2025-03-21T07:39:19.000Z","dependencies_parsed_at":"2024-02-20T06:22:46.039Z","dependency_job_id":"99f21763-98d2-495a-a95c-520664ffbfb9","html_url":"https://github.com/clearlyip/laravel-flagsmith","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.3076923076923077,"last_synced_commit":"10ac87f9c43420e3b9c7ff6b6d144047b759828c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlyip%2Flaravel-flagsmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlyip%2Flaravel-flagsmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlyip%2Flaravel-flagsmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlyip%2Flaravel-flagsmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clearlyip","download_url":"https://codeload.github.com/clearlyip/laravel-flagsmith/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233935,"owners_count":21069493,"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":["composer","laravel","php"],"created_at":"2024-09-24T23:45:59.433Z","updated_at":"2025-04-10T14:21:41.229Z","avatar_url":"https://github.com/clearlyip.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"100%\" src=\"https://github.com/Flagsmith/flagsmith/raw/main/static-files/hero.png\"/\u003e\n\nLaravel-flagsmith was created by, and is maintained by **[Andrew Nagy](https://github.com/tm1000)**, the package is designed to allow Laravel to work with [Flagsmith](https://flagsmith.com/)\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/clearlyip/laravel-flagsmith\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/clearlyip/laravel-flagsmith\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/clearlyip/laravel-flagsmith\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/clearlyip/laravel-flagsmith\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/clearlyip/laravel-flagsmith\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/clearlyip/laravel-flagsmith\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n-   Provides a trait to be able to get flags based on Laravel Users ([Flagsmith Identities](https://docs.flagsmith.com/basic-features/managing-identities))\n-   Utilizes [Laravel's Queue](https://laravel.com/docs/8.x/queues) system to update flags in the background\n-   Utilizes [Laravel's Cache](https://laravel.com/docs/8.x/cache) system to store flags in a cache for quick access\n-   Utilizes [Laravel's Task Scheduling](https://laravel.com/docs/8.x/scheduling) system to update flags on a schedule\n-   Adds a route to utilize [Flagsmith's webhooks](https://docs.flagsmith.com/advanced-use/system-administration) to update the cache when flags change\n\n## Installation \u0026 Usage\n\n\u003e **Requires [PHP 8.2+](https://php.net/releases/)**\n\nRequire Laravel-flagsmith using [Composer](https://getcomposer.org):\n\n```bash\ncomposer require clearlyip/laravel-flagsmith\n```\n\n## Laravel Version Compatibility\n\n| Laravel | Laravel Flagsmith |\n| :------ | :---------------- |\n| 8.x     | 1.x               |\n| 9.x     | 2.x               |\n| 10.x    | 3.x               |\n\n## Usage\n\n### Configuration Files\n\n-   Publish the Laravel Flagsmith configuration file using the `vendor:publish` Artisan command. The `flagsmith` configuration file will be placed in your `config` directory (Use `--force` to overwrite your existing `clearly` config file):\n    -   `php artisan vendor:publish --tag=\"flagsmith\" [--force]`\n\nAll options are fully documented in the configuration file\n\n### User\n\nIt's advised to add the interface `Clearlyip\\LaravelFlagsmith\\Contracts\\UserFlags` to your user model. This will give you the ability to access flags directly from your user object.\n\nYou can add the following trait `Clearlyip\\LaravelFlagsmith\\Concerns\\HasFlagss` to your user model to fulfill the requirements of `UserFlags`\n\nDuring initial login user flags are synced through a queue which keeps them as up to date as possible\n\n#### Get All Flags for a User\n\n```php\n$user = Auth::user();\n$flags = $user-\u003egetFlags();\n```\n\n### Check if flag is enabled for a user\n\nAn optional second parameter can be added as the default if the flag does not exist\n\n```php\n$user = Auth::user();\n$flags = $user-\u003eisFlagEnabled('foo');\n```\n\n#### Get a Flag value for a User\n\nAn optional second parameter can be added as the default if the flag does not exist\n\n```php\n$user = Auth::user();\n$vakue = $user-\u003egetFlagValue('foo');\n```\n\n### Accessing\n\nThe Flagsmith Class can be accessed through Laravel's Container. The returned class is simply [flagsmith-php-client](https://github.com/Flagsmith/flagsmith-php-client)\n\n```php\n$flagsmith = App::make(Flagsmith::class);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearlyip%2Flaravel-flagsmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearlyip%2Flaravel-flagsmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearlyip%2Flaravel-flagsmith/lists"}