承接 darvis/nuki 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

darvis/nuki

最新稳定版本:v1.0.2

Composer 安装命令:

composer require darvis/nuki

包简介

Laravel package for the NUKI Web API (smartlocks, logs, authorizations, webhooks).

README 文档

README

Latest version on Packagist Tests Total downloads License

A Laravel package for the NUKI Web API. Provides a clean, typed interface for managing smartlocks, fetching activity logs, managing authorizations (keypad codes / app users), and receiving webhook callbacks.

  • PHP 8.2+ — Laravel 11, 12, 13
  • Bearer (API token) and OAuth 2.0 Authorization Code support
  • Account-aware: a single application can manage multiple NUKI accounts
  • Webhook receiver with HMAC signature verification and idempotent dispatch
  • Built-in Livewire 3.5+ / 4 + Flux 2 UI: dashboard, activity timeline, smartlocks, keypad authorizations, webhooks and OAuth status
  • Optional self-contained user-auth (darvis-nuki guard) with email OTP, sub-users, per-smartlock permissions and a weekday bitmask

Documentation

Full developer documentation lives in docs/. Quick links:

Installation

composer require darvis/nuki
php artisan vendor:publish --tag=nuki-config
php artisan migrate

Service provider and Nuki facade are auto-discovered.

Minimal .env (token mode, single account)

NUKI_AUTH=token
NUKI_TOKEN_RESOLVER=config
NUKI_API_TOKEN=your-personal-api-token-from-web-nuki-io

Generate the token in the NUKI Web portal under API. For multi-account or OAuth, see NUKI API authentication.

Hello world

use Darvis\Nuki\Facades\Nuki;

$locks = Nuki::smartlocks()->all();          // Collection<SmartLock>
$lock  = Nuki::smartlocks()->find($id);      // SmartLock

Nuki::smartlocks()->lock($id);
Nuki::smartlocks()->unlock($id);

$entries = Nuki::logs()->forSmartlock($id, ['limit' => 50]);

Nuki::auths()->create($id, [
    'name' => 'Cleaning lady',
    'type' => 13,                            // keypad code
    'code' => 123456,
]);

For everything else — every method on every resource, the DTO shapes, multi-account, OAuth, webhooks, the bundled UI, the optional user-auth — see docs/.

Webhooks

NUKI_WEBHOOK_ENABLED=true
NUKI_WEBHOOK_SECRET=a-long-random-string

Listen for inbound events:

use Darvis\Nuki\Events\NukiWebhookReceived;

Event::listen(NukiWebhookReceived::class, function (NukiWebhookReceived $event) {
    // $event->type, $event->payload, $event->accountKey
});

See docs/webhooks.md for signature verification, deduplication and registering the callback with NUKI.

Demo mode

NUKI_DEMO=true

Intercepts every call to api.nuki.io and answers with realistic canned data. Combine with php artisan db:seed --class="Darvis\\Nuki\\Database\\Seeders\\NukiDemoSeeder" to populate the multi-account switcher. Perfect for screenshots and walk-throughs; never enable in production. See docs/demo-mode.md.

User authentication (optional)

NUKI_AUTH_USERS_ENABLED=true
php artisan nuki:user-create --email=admin@example.com --name=Admin --password=secret123

Registers a darvis-nuki auth guard, gates /nuki/* behind it, and ships login / OTP / register / password-reset Livewire screens. Main users can create sub-users with per-smartlock permissions, a validity window and a weekday bitmask. See docs/users-and-permissions.md.

Testing

composer test

Credits

License

MIT — see LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固