Download the PHP package spaanproductions/laravel-switchbot-frame without Composer

On this page you can find all versions of the php package spaanproductions/laravel-switchbot-frame. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-switchbot-frame

Laravel SwitchBot AI Art Frame

Latest Version on Packagist Tests

A standalone Laravel + Livewire admin page for the SwitchBot AI Art Frame. Upload photos, optimize them for the E Ink Spectra 6 panel, push them to the frame, and read the real battery level from SwitchBot's change-report webhook — all from one self-contained page that ships its own compiled CSS, so it does not depend on your application's Tailwind build. Optionally, generate and iteratively edit art with AI right from the page (see AI Image Studio).

Requirements

[!NOTE] This package controls the frame through SwitchBot's Cloud API, so a SwitchBot Hub is required to work remotely — the Hub bridges the AI Art Frame to the SwitchBot cloud. Without a Hub, the Cloud API cannot reach the frame.

Installation

Add your SwitchBot Open API credentials to .env (Profile → Preferences → tap App Version ~10× in the SwitchBot app to unlock Developer Options):

The page is served at /switchbot by default and requires login — it ships with ['web', 'auth:sanctum'] route middleware. Add any further authorization (roles, gates, a super-admin guard) via the config (see Configuration).

Configuration

Publish the config to change the URL, middleware, disk, preview aspect ratios, and the back-link:

AI Image Studio

Generate frame art from a text prompt — and iteratively edit it in a chat — powered by the optional laravel/ai package. Describe an image (optionally starting from an uploaded photo), refine it with follow-up prompts, then save the result straight into your library, where it's optimized for the panel like any other image. Past conversations are browsable, and deleting one also deletes its generated preview images.

The Studio is opt-in: it only appears when laravel/ai is installed and enabled in config, so you can leave it off even when the package is present.

A Create with AI button then appears on the gallery, linking to the Studio at /switchbot/studio (behind the same route middleware as the rest of the page). Each library card also gets an Edit with AI button to start a conversation from that image.

Image generation uses laravel/ai's own provider configuration and auth tokens (OPENAI_API_KEY, GEMINI_API_KEY, …) from your .env. Supported image providers are OpenAI, Gemini, xAI, Azure, Bedrock and OpenRouter — the providers supported at the time of writing. Actual support depends on your installed laravel/ai version; see laravel/ai provider support for the current list.

[!NOTE] laravel/ai ships with Gemini as its default image provider. If you'd rather use OpenAI (e.g. you already have OPENAI_API_KEY), set SWITCHBOT_AI_IMAGE_PROVIDER=openai — otherwise add a GEMINI_API_KEY.

[!WARNING] Cost estimation is experimental. When enabled, a queued job estimates the USD cost of each generation and prompt improvement from token counts and public per-token prices from LiteLLM's price sheet (fetched and cached, refreshed every SWITCHBOT_AI_COST_REFRESH_HOURS). Figures are a rough indication only and must not be used for invoicing, budgeting or any correctness-sensitive purpose.

[!IMPORTANT] Image generation and the e-ink optimization run on the queue and can take a while. GenerateAiImageJob allows up to 120 seconds, so your queue worker's timeout must be at least that — run php artisan queue:work --timeout=120 (or set the supervisor's timeout to 120+ in config/horizon.php when using Horizon). If the worker runs under Supervisor, set its stopwaitsecs higher than the worker timeout (e.g. 130) so a deploy/restart doesn't kill a job mid-generation, and keep the connection's retry_after (config/queue.php) above the timeout as well, or a slow generation may be retried while it is still running.

Standalone CSS

Out of the box the page loads a pre-compiled Tailwind stylesheet from the package route route('switchbot.assets.css') — no host build step required. Publish it to have the web server serve it statically instead (faster, and lets you tweak the compiled file):

Once it exists at public/vendor/switchbot/app.css, the page links to it directly and the route serves it too — so your published (or customized) copy always wins.

Customizing the layout

Every layout partial (head, styles, header, scripts) and the Livewire views are publishable and overridable:

Edit resources/views/vendor/switchbot/partials/head.blade.php to add SEO/meta/favicons, or .../partials/styles.blade.php to change the accent colour and fonts.

Battery webhook

The status API reports the battery stuck at 0%, so the real level comes from SwitchBot's change-report webhook. Register this app's public HTTPS receiver:

Screenshots

The gallery AI Studio — empty AI Studio — a conversation
Your library, the live frame preview and the battery webhook. Start a new conversation: choose a shape, tap an example or write your own prompt, and optionally improve it with AI. Generate & refine: the result with its size and token counts, ready to refine further or save to the library.

Click a screenshot for the full-size version.

License

Licensed under the Spaan Productions.


All versions of laravel-switchbot-frame with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-gd Version *
illuminate/bus Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/queue Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
livewire/livewire Version ^4.0
blade-ui-kit/blade-heroicons Version ^2.6
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spaanproductions/laravel-switchbot-frame contains the following files

Loading the files please wait ...