chaseconey / laravel-storyblok
A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs
Fund package maintenance!
Ko Fi
Requires
- php: ^7.1|^8.0
- ext-json: *
- embed/embed: ^3.4
- illuminate/support: ^6.0|^7.0|^8.0
- league/commonmark: ^1.5
- mundschenk-at/php-typography: ^6.5
- spatie/schema-org: ^2.14
- storyblok/php-client: ^1.4
- storyblok/richtext-resolver: dev-master
Requires (Dev)
- mockery/mockery: ^1.2
- orchestra/testbench: 6.0.*
- phpunit/phpunit: ^8.0
- dev-master
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-beta4
- 2.0.0-beta3
- 2.0.0-beta2
- 2.0.0-beta1
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-beta2
- 1.0.0-beta1
- 0.2.0
- 0.1.10
- 0.1.9
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-develop
- dev-featureRefactor_fields
This package is auto-updated.
Last update: 2024-10-27 20:56:01 UTC
README
This package allows you to use fantastic Storyblok headless CMS with the amazing Laravel PHP framework. It’s designed to try and feel natural to Laravel developers and part of the ecosystem whilst also converting Storyblok’s API JSON responses into something powerful with minimal effort.
Key Features
- Pages from Storyblok mapped to PHP Pages classes giving access to the nested content (Blocks) and meta data for SEO, OpenGraph and more.
- Each Storyblok component is automatically transformed into a PHP class using a simple naming convention - just match your class and component names.
- NEW! All fields in your components are converted to a Field PHP class allowing you to manipulate their data. The package automatically detects common types like rich text fields, assets and markdown.
- Asset fields are converted to Assets classes allowing you to manipulate them as required.
- Blocks and fields know where they sit in relation to their ancestors and CSS classes can be created to help your styling.
- The structure of the JSON data is preserved but super powered making it simple to loop over in your views.
- It’s simple to link to the Storyblok visual composer by including one view and calling a method for each block in your Blade.
- Request ‘Folders’ of content such as a list of articles or a team of people.
- Feels like Laravel - use date casting and accessors exactly as you would with models.
- Richer Typography with PHP Typography baked in.
Documentation
Future plans
- More transformations of content
- Better support for more components types
- Better image transformation
- Cache expensive transformations
- And more…
Testing
The tests are mostly up-to-date and cover the majority of the code. A few areas that would require hitting the Storyblok API are not tested. If you have experience mocking API please feel free to contribute tests.
Changelog
Contributing
Please feel free to help expand and improve this project. The package uses Git Flow but you can submit a pull request to be merged to the develop branch.
Security
If you discover any security related issues, please email ric@wearebwi.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.