{"id":28951574,"url":"https://github.com/invokable/laravel-switchbot","last_synced_at":"2026-04-02T02:07:19.592Z","repository":{"id":61092911,"uuid":"548256793","full_name":"invokable/laravel-switchbot","owner":"invokable","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-18T11:55:09.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-30T02:44:47.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/revolution/laravel-switchbot","language":"PHP","has_issues":false,"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/invokable.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},"funding":{"github":["invokable"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2022-10-09T07:41:33.000Z","updated_at":"2026-03-18T11:55:13.000Z","dependencies_parsed_at":"2024-03-29T08:43:27.117Z","dependency_job_id":"e44f1671-edb1-4237-bb49-1c8a0573bef3","html_url":"https://github.com/invokable/laravel-switchbot","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"f922ec698eadd9c37e2d5471bb8e664debb526e0"},"previous_names":["kawax/laravel-switchbot"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/invokable/laravel-switchbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-switchbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-switchbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-switchbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-switchbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invokable","download_url":"https://codeload.github.com/invokable/laravel-switchbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invokable%2Flaravel-switchbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-06-23T15:05:50.283Z","updated_at":"2026-04-02T02:07:19.584Z","avatar_url":"https://github.com/invokable.png","language":"PHP","funding_links":["https://github.com/sponsors/invokable"],"categories":[],"sub_categories":[],"readme":"# SwitchBot API for Laravel\n\nThis package provides a simple integration with the SwitchBot API using Laravel's HTTP client macros.\n\nFor specific API details, please refer to the official SwitchBot API repository: https://github.com/OpenWonderLabs/SwitchBotAPI\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/invokable/laravel-switchbot)\n\n## Requirements\n\n- PHP \u003e= 8.3\n- Laravel \u003e= 12.0\n\n## Installation\n\n```shell\ncomposer require revolution/laravel-switchbot\n```\n\n## Configuration\n\nGet tokens from the SwitchBot app.\n\n### .env\n\n```\nSWITCHBOT_TOKEN=\nSWITCHBOT_SECRET=\n```\n\n## Usage\n\nBuilt as a Laravel HTTP client macro.\n\n```php\nuse Illuminate\\Support\\Facades\\Http;\n\n$response = Http::switchbot()-\u003eget('devices');\n\ndump($response-\u003ejson());\n\n$deviceId = $response-\u003ejson('body.deviceList.0.deviceId');\nif (filled($deviceId)) {\n    $response = Http::switchbot()-\u003eget(\"devices/$deviceId/status\");\n    dump($response-\u003ejson());\n}\n```\n\n```php\nuse Illuminate\\Support\\Facades\\Http;\n\n$response = Http::switchbot()-\u003eget('scenes');\ndump($response-\u003ejson());\n```\n\n## Testing\n\n```php\nuse Illuminate\\Support\\Facades\\Http;\n\nHttp::fake([\n    '*' =\u003e Http::response([\n        \"statusCode\" =\u003e 100,\n        \"body\" =\u003e [\n            \"deviceList\" =\u003e [],\n            \"infraredRemoteList\" =\u003e [],\n        ],\n        \"message\" =\u003e \"success\",\n   ]),\n]);\n\n$response = Http::switchbot()-\u003eget('devices');\n\n$this-\u003eassertSame(100, $response-\u003ejson('statusCode'));\n```\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvokable%2Flaravel-switchbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvokable%2Flaravel-switchbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvokable%2Flaravel-switchbot/lists"}