NUKI for Laravel

darvis/nuki lets a Laravel application talk to the NUKI Web API: list the smartlocks of a NUKI account, lock and unlock them, read the activity log and manage keypad codes. It also ships a webhook receiver, a set of Livewire pages and, optionally, its own users with permissions per lock.

It is for developers who build access control into a Laravel application: an office, a rental home, a workshop, or a platform with a NUKI account per customer.

What the package does not do

  • It does not talk to a lock or a bridge directly. Every call goes to the NUKI Web API over the internet, so the lock has to be available in NUKI Web.
  • It does not tell you that the bolt moved. lock() and unlock() return nothing; a call that did not throw means NUKI accepted the command. Read the state again or listen for a webhook.
  • It registers no OAuth callback route. With OAuth your application builds the route that NUKI redirects to. See API authentication.
  • It writes nothing about its own users and permissions back to the NUKI account.

Requirements

  • PHP 8.2 or higher
  • Laravel 11, 12 or 13
  • Livewire 3.5 or higher, or Livewire 4
  • Flux 2 (the free edition is enough)
  • A NUKI account with access to NUKI Web, and an API token or an OAuth application for it

Livewire and Flux are Composer requirements of the package, so they are installed with it, also when you only use the facade.

Install

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

Installation has the full steps and a way to check that it works.

The pages

Start here

  • Installation: the steps from composer require to a first answer from NUKI, and how to check that it works.
  • Quick start: one complete example, a page that lists the locks and locks or unlocks one.
  • Configuration: every config/nuki.php key and NUKI_* variable with its default.

The NUKI Web API

  • API authentication: a personal API token or OAuth 2.0, one account or many, and the callback route you build yourself.
  • API reference: every public method on the resources, the objects they return, the console commands and the exceptions.

The bundled UI and its users

  • UI and localization: who may open the pages, the components, the layout and the four languages.
  • Users and permissions: the optional darvis-nuki guard, main and sub users, and permissions per lock.
  • Auth routes: every route the package registers and where a guest is sent.

Running it

  • Webhooks: the receiver, the signature check, duplicates and the event you listen for.
  • Demo mode: the whole UI on made up data, without a NUKI account.
  • Testing: test your own code without calling NUKI.
  • Troubleshooting: symptom, cause and fix, with the literal error messages.
  • FAQ: the short answers.