PHP code example of spaanproductions / laravel-switchbot-frame

1. Go to this page and download the library: Download spaanproductions/laravel-switchbot-frame library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spaanproductions / laravel-switchbot-frame example snippets


// config/switchbot.php
'routes' => [
    'prefix' => 'switchbot',
    'middleware' => ['web', 'auth:sanctum'], // add further authorization here
    'webhook' => ['prefix' => '', 'middleware' => ['api']],
],

'back_link' => ['label' => 'Back', 'url' => null], // shown only when url (or route) is set

'aspect' => [
    'now_showing' => 'portrait',   // portrait | landscape | square
    'dropzone' => 'portrait',
],
bash
php artisan vendor:publish --tag=switchbot-frame-config
bash
composer vendor:publish --provider="Laravel\Ai\AiServiceProvider"
php artisan migrate
bash
php artisan vendor:publish --tag=switchbot-frame-assets
bash
php artisan vendor:publish --tag=switchbot-frame-views
bash
php artisan switchbot:webhook          # register
php artisan switchbot:webhook --list   # list registered
php artisan switchbot:webhook --delete # remove