{"id":40166146,"url":"https://github.com/monooso/unobserve","last_synced_at":"2026-01-19T16:37:13.395Z","repository":{"id":35132486,"uuid":"210830784","full_name":"monooso/unobserve","owner":"monooso","description":"Mute and unmute Laravel observers at will.","archived":false,"fork":false,"pushed_at":"2025-11-26T21:59:26.000Z","size":372,"stargazers_count":82,"open_issues_count":3,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-27T15:30:26.833Z","etag":null,"topics":["laravel","laravel-package","php"],"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/monooso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-09-25T11:42:44.000Z","updated_at":"2025-11-26T21:59:24.000Z","dependencies_parsed_at":"2024-06-18T17:06:22.620Z","dependency_job_id":"62eccad8-e28b-443f-ab31-d520bd4f92a9","html_url":"https://github.com/monooso/unobserve","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/monooso/unobserve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monooso%2Funobserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monooso%2Funobserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monooso%2Funobserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monooso%2Funobserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monooso","download_url":"https://codeload.github.com/monooso/unobserve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monooso%2Funobserve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28574656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T16:29:19.148Z","status":"ssl_error","status_checked_at":"2026-01-19T16:29:17.772Z","response_time":67,"last_error":"SSL_read: 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":["laravel","laravel-package","php"],"created_at":"2026-01-19T16:37:13.322Z","updated_at":"2026-01-19T16:37:13.385Z","avatar_url":"https://github.com/monooso.png","language":"PHP","readme":"# Unobserve\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/monooso/unobserve/actions/workflows/lint-and-test.yml\"\u003e\u003cimg src=\"https://github.com/monooso/unobserve/actions/workflows/lint-and-test.yml/badge.svg\" alt=\"Lint and Test Status\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://scrutinizer-ci.com/g/monooso/unobserve\"\u003e\u003cimg src=\"https://img.shields.io/scrutinizer/g/monooso/unobserve.svg\" alt=\"Quality Score\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://scrutinizer-ci.com/g/monooso/unobserve\"\u003e\u003cimg src=\"https://img.shields.io/scrutinizer/coverage/g/monooso/unobserve.svg\" alt=\"Coverage\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/monooso/unobserve\"\u003e\u003cimg src=\"https://poser.pugx.org/monooso/unobserve/v/stable.svg\" alt=\"Latest Stable Version\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/monooso/unobserve\"\u003e\u003cimg src=\"https://poser.pugx.org/monooso/unobserve/license.svg\" alt=\"License\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About Unobserve\nWhen testing Laravel applications, we frequently need to \"silence\" events, so as not to trigger additional side-effects. [Laravel's `Event::fake` method](https://laravel.com/docs/mocking#event-fake) is useful, but muting a specific [model observer](https://laravel.com/docs/eloquent#observers) is still problematic.\n\nUnobserve takes care of that, making it easy to mute and unmute an observer at will.\n\n## Requirements and installation\nSelect the appropriate version of Unobserve from the following table.\n\n| Unobserve | Laravel | PHP |\n|:-------|:-----------------|:------------|\n| 1.x    | `^5.8`, `^6.0`   | `^7.2`      |\n| 2.x    | `^7.0`           | `^7.2.5`    |\n| 3.x    | `^8.0`           | `^7.3.0`    |\n| 4.x    | `^8.0`           | `^8.0.0`    |\n| 5.x    | `^9.0`, `^10.0`  | `^8.0.0`    |\n| 6.x    | `^11.0`, `12.0`  | `^8.2.0`    |\n\nInstall Unobserve using [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require monooso/unobserve\n```\n\n## Usage\nFirst, add the `CanMute` trait to your observer class.\n\n```php\n\u003c?php\n\nnamespace App\\Observers;\n\nuse Monooso\\Unobserve\\CanMute;\n\nclass UserObserver\n{\n    use CanMute;\n}\n```\n\nYou can now mute and unmute your observer as needed:\n\n```php\nUserObserver::mute();\nUserObserver::unmute();\n```\n\n## Mute options\n\nMute all observer events:\n\n```php\nUserObserver::mute();\n```\n\nMute specific observer events:\n\n```php\nUserObserver::mute('creating');\nUserObserver::mute(['creating', 'created']);\n```\n\n## Development\nUnobserve is very stable at this point. If you have any feature ideas please [open an issue](https://github.com/monooso/unobserve/issues/new) before doing any work.\n\nHere's how to set everything up for local development on Unobserve [^development]:\n\n[^development]: I'm assuming you know your way around PHP, and already have your environment set up.\n\n1. Clone the repository.\n2. Install the dependencies by running `composer install`.\n3. Install the code quality tools by running `composer install --working-dir=tools/php-cs-fixer`.\n4. Set your Git hooks directory to `.githooks` by running `git config core.hooksPath .githooks`.\n\n## License\nUnobserve is open source software, released under [the MIT license](https://github.com/monooso/unobserve/blob/master/LICENSE.txt).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonooso%2Funobserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonooso%2Funobserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonooso%2Funobserve/lists"}