tuxonice / storyblok-transfers
Generate PHP transfer objects from your Storyblok components, and read stories from the Content Delivery API straight into them
v0.4.0
2026-11-10 15:23 UTC
Requires
- php: ^8.3
- ext-json: *
- guzzlehttp/guzzle: ^7.0 || ^8.0
- psr/clock: ^1.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- psr/simple-cache: ^2.0 || ^3.0
- tuxonice/transfer-objects: ^1.2
Requires (Dev)
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^3.13.6 || ^4.0.0
- storyblok/richtext-resolver: ^2.2
- symfony/cache: ^7.4
- symfony/clock: ^7.4
- symfony/var-dumper: ^6.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Typed PHP objects for your Storyblok content, in any framework.
- Generate a PHP transfer class for every component in your Storyblok space.
- Read stories from the Content Delivery API straight into those classes, with relations, drafts, languages, links and datasources.
Storyblok space ──generate──▶ PageTransfer, HeroTransfer, …
Storyblok story ──read──────▶ $story->getContent() // PageTransfer
Installation
composer require tuxonice/storyblok-transfers
Requires PHP 8.3+.
In short
# Generate classes from your space's components
STORYBLOK_SPACE_ID=290156928914344 \
STORYBLOK_MANAGEMENT_TOKEN=your-personal-access-token \
vendor/bin/generate
use App\DataTransferObjects\PageTransfer; use Tlab\StoryblokTransfers\Content\StoryblokContent; // Reads STORYBLOK_DELIVERY_TOKEN from the environment $storyblok = StoryblokContent::fromEnvironment(); $story = $storyblok->stories()->bySlug('home', PageTransfer::class); echo $story?->getContent()->getTitle(); // a typed PageTransfer
Start with Getting started, which walks through this from an empty project.
Documentation
- Getting started
- Generating transfers
- Reading content
- Relations
- Rich text
- Links and datasources
- Hydrating content yourself
- Caching
- Using it with Laravel or with Symfony
- Limitations
- Reference: configuration, field types, errors
What's changed: CHANGELOG.md. Working on the package itself? See CONTRIBUTING.md.
License
MIT. See LICENSE.