Skip to main content
Any call is one or two lines through the Attract facade: nothing to import beyond it, nothing to catch, and a test of it is three lines. The SDK handles the rest.

fetchski/attract-cms-laravel

Laravel 12 or 13 · PHP 8.5.12+ · Guzzle 7.10+ or 8.3+

What it does for you

Typed answers

Readonly objects with properties: Collections, Carbon dates, PHP enums. No null checks on what the site always sends.

Nothing to catch

Laravel’s handler logs and renders every failure; a refused value is a normal validation error.

Safe retries

Rate limits waited out; reads retried when the site doesn’t answer.

Whole lists

…All() walks every page as a LazyCollection, however the list pages.

Three-line tests

Attract::fake(), a factory for every model, and assertCalled.

Artisan tools

Scaffold an Action, list every method, call one from the CLI, check a site.

The guides

Installation

Install it from your own site, then into your app. Install the SDK →

Configuration

One site from .env, more by hand, or a table. Configure →

Calling the API

Arguments, answers, lists, jobs and uploads. Make calls →

Errors, paging and testing

Artisan commands

Install the SDK into your app: publish the config, write the site’s URL, key and signing secret to .env, and check the site (Installation):
Terminal
Or keep the key encrypted in the package’s attract_api_keys table instead of .env (Key in the database):
Terminal
Store or replace the key in that table:
Terminal
Swap a stored key for a new one from the site’s CMS:
Terminal
Delete the stored key from that table:
Terminal
Scaffold an Action for any method, and its test, in the app or a module (add --module=<Name> or --app):
Terminal
List every method of an accessor, with its HTTP route and purpose:
Terminal
Call any method on the real site and print the answer:
Terminal
Check the config, the site, the key and the clock:
Terminal
Call every read the site offers and report what broke:
Terminal

Every command, with its options

What each command does, when to use it, and examples to copy.

The reference

Every method has its own page in this tab’s sidebar, grouped like the API reference.

The call, ready to copy

One or two lines, pinned beside the page.

Its arguments

Named arguments with their types, a body’s fields among them.

What it returns

Each property of the answer, typed, with nested models one click away.

Its test and its Action

A three-line fake, and the Artisan line that scaffolds the Action.

Start with Pages → List

The first method in the reference.
Your own site serves the package: any of its API keys installs it, no other account needed. Using TypeScript? See the TypeScript SDK.