### Install laravel-webflow via Composer Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Install the package via Composer. ```bash composer require jeffersongoncalves/laravel-webflow ``` -------------------------------- ### Sites: listSites, getSite, publishSite Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Use the Webflow facade to list sites, get a site by ID, and publish a site with custom domains and the Webflow subdomain option. ```php use Jeffersongoncalves\Webflow\Facades\Webflow; $sites = Webflow::listSites(); $site = Webflow::getSite('siteId'); Webflow::publishSite('siteId', customDomains: ['www.example.com'], publishToWebflowSubdomain: true); ``` -------------------------------- ### Collection items: list, get, create, update, publish Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Manage collection items: list with pagination, get a single item, create a draft item, update an item, and bulk publish items. ```php $items = Webflow::listCollectionItems('collectionId', limit: 10, offset: 0); $item = Webflow::getCollectionItem('collectionId', 'itemId'); Webflow::createCollectionItem('collectionId', fieldData: [ 'name' => 'My New Item', 'slug' => 'my-new-item', ], isDraft: true); Webflow::updateCollectionItem('collectionId', 'itemId', fieldData: [ 'name' => 'Updated Item', ]); Webflow::publishCollectionItems('collectionId', ['itemId1', 'itemId2']); ``` -------------------------------- ### Run tests with composer test Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Run the package test suite. ```bash composer test ``` -------------------------------- ### Publish laravel-webflow config Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Publish the package configuration file. ```bash php artisan vendor:publish --tag="laravel-webflow-config" ``` -------------------------------- ### Collections: listCollections Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md List all collections for a given site. ```php $collections = Webflow::listCollections('siteId'); ``` -------------------------------- ### Forms: listForms and listFormSubmissions Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md List forms for a site and retrieve form submissions with pagination. ```php $forms = Webflow::listForms('siteId'); $submissions = Webflow::listFormSubmissions('formId', limit: 25, offset: 0); ``` -------------------------------- ### Set WEBFLOW_API_TOKEN in .env Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Add your Webflow API token to the .env file. ```env WEBFLOW_API_TOKEN=your-webflow-api-token ``` -------------------------------- ### Published config file for laravel-webflow Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Contents of the published config file. The token is read from the WEBFLOW_API_TOKEN environment variable, and the base URL defaults to https://api.webflow.com/v2. ```php return [ 'token' => env('WEBFLOW_API_TOKEN'), 'base_url' => env('WEBFLOW_BASE_URL', 'https://api.webflow.com/v2'), ]; ``` -------------------------------- ### Error handling with WebflowException Source: https://github.com/jeffersongoncalves/laravel-webflow/blob/main/README.md Catch WebflowException on non-2xx responses and log the error message and decoded error body. ```php use Jeffersongoncalves\Webflow\Exceptions\WebflowException; try { Webflow::publishSite('siteId'); } catch (WebflowException $e) { logger()->error($e->getMessage(), $e->errorBody()); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.