Skip to content

roberto-butti/laravel-storyblok

 
 

Repository files navigation

Use Storyblok’s amazing headless CMS in way that feels familiar to Laravel developers

Latest Version on Packagist Total Downloads

GitHub Workflow Status Packagist PHP Version

Build Quality Score

ko-fi Twitter

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 complete with pagination.
  • Feels like Laravel - use date casting and accessors exactly as you would with models.
  • Richer Typography using a supporting package utilising PHP Typography.

Documentation

Read the full docs

Contribute to the docs

Other Packages

Laravel Storyblok Embed

Embed all types of media in your Storyblok site using only their URL. Package Docs

Laravel Storyblok Typography

Improve your content’s typography. Package Docs

Laravel Storyblok Layout & CSS

Helpers for layout, block positioning and CSS class name generation. Package Docs

Laravel Storyblok Form builder (BETA)

Build forms with Storyblok complete with Laravel’s validation. Package Docs

Laravel Storyblok CLI

Useful Artisan commands to help manage your content? Check out my Laravel Storyblok CLI package

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

See it here

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 [email protected] 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.

About

Make Laravel and Storyblok work together beautifully.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • PHP 98.7%
  • Blade 1.3%