PHPackages                             revolution/laravel-switchbot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. revolution/laravel-switchbot

ActiveLibrary[API Development](/categories/api)

revolution/laravel-switchbot
============================

SwitchBot API for Laravel

1.4.0(2mo ago)07.5kMITPHPPHP ^8.3CI passing

Since Oct 9Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/invokable/laravel-switchbot)[ Packagist](https://packagist.org/packages/revolution/laravel-switchbot)[ GitHub Sponsors](https://github.com/invokable)[ RSS](/packages/revolution-laravel-switchbot/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

SwitchBot API for Laravel
=========================

[](#switchbot-api-for-laravel)

This package provides a simple integration with the SwitchBot API using Laravel's HTTP client macros.

For specific API details, please refer to the official SwitchBot API repository:

[![Ask DeepWiki](https://camo.githubusercontent.com/0f5ae213ac378635adeb5d7f13cef055ad2f7d9a47b36de7b1c67dbe09f609ca/68747470733a2f2f6465657077696b692e636f6d2f62616467652e737667)](https://deepwiki.com/invokable/laravel-switchbot)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Laravel &gt;= 12.0

Installation
------------

[](#installation)

```
composer require revolution/laravel-switchbot
```

Configuration
-------------

[](#configuration)

Get tokens from the SwitchBot app.

### .env

[](#env)

```
SWITCHBOT_TOKEN=
SWITCHBOT_SECRET=

```

Usage
-----

[](#usage)

Built as a Laravel HTTP client macro.

```
use Illuminate\Support\Facades\Http;

$response = Http::switchbot()->get('devices');

dump($response->json());

$deviceId = $response->json('body.deviceList.0.deviceId');
if (filled($deviceId)) {
    $response = Http::switchbot()->get("devices/$deviceId/status");
    dump($response->json());
}
```

```
use Illuminate\Support\Facades\Http;

$response = Http::switchbot()->get('scenes');
dump($response->json());
```

Testing
-------

[](#testing)

```
use Illuminate\Support\Facades\Http;

Http::fake([
    '*' => Http::response([
        "statusCode" => 100,
        "body" => [
            "deviceList" => [],
            "infraredRemoteList" => [],
        ],
        "message" => "success",
   ]),
]);

$response = Http::switchbot()->get('devices');

$this->assertSame(100, $response->json('statusCode'));
```

LICENSE
-------

[](#license)

MIT

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance86

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 93.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~246 days

Recently: every ~296 days

Total

6

Last Release

86d ago

PHP version history (4 changes)1.0.0PHP ^8.0

1.2.0PHP ^8.1

1.3.0PHP ^8.2

1.4.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77618633?v=4)[Revolution](/maintainers/revolution)[@Revolution](https://github.com/Revolution)

---

Top Contributors

[![kawax](https://avatars.githubusercontent.com/u/1502086?v=4)](https://github.com/kawax "kawax (31 commits)")[![devin-ai-integration[bot]](https://avatars.githubusercontent.com/in/811515?v=4)](https://github.com/devin-ai-integration[bot] "devin-ai-integration[bot] (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

laravelSwitchBot

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/revolution-laravel-switchbot/health.svg)

```
[![Health](https://phpackages.com/badges/revolution-laravel-switchbot/health.svg)](https://phpackages.com/packages/revolution-laravel-switchbot)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
