Class properties have had type added - any classes that extend these classes will need to be updated to match. For example if you’re using protected $_resolveRelations = ['something]
you’ll need to change it to protected array $_resolveRelations = ['something]
.
If you use either the AppliesTypography
or CssClasses
traits these have been moved to separate packages and must be installed and the namespace updated. see:
Folders have been reworked with the stories now sitting under the stories
property. They also now support pagination.
@foreach ($news->stories as $article)
{{ $article->title }}
@endforeach
{!! $news->paginate()->links() !!}
If you are using the default package webhook handler this functionality has changed to use Laravel events. Make sure you register this in your App\Providers\EventServiceProvider
.
use Riclep\Storyblok\Events\StoryblokPublished;
use Riclep\Storyblok\Listeners\ClearCache;
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
StoryblokPublished::class => [
ClearCache::class,
],
StoryblokUnpublished::class => [
ClearCache::class
]
];
The updated image transformation service requires you to define a transformer in the Storyblok config file. The default transformer is Riclep\Storyblok\Support\ImageTransformers\Storyblok
which uses the new image service URLs. To use your own set the config image_transformer
key.
The meta()
width and height details have been removed from image fields as each transformer will offer different features. Image field contains a width()
and height()
methods which will check the transformer for values or the image if not transformed.
Two config keys have been renamed with underscores for consistency: live-preview
-> live_preview
and live-element
-> live_element
. The package template files have been updated but any custom files will need amending.
To enable live preview support include the latest laravel-storyblok::editor-bridge
in your view and adding the required wrapping element and configuration options.
Set up the publishing webhook as specified in the installation instructions. Removed the JavaScript published event from the Editor Bridge Blade view.
Legacy image fields are now converted to Image classes.
The $casts
property on Blocks has been renamed to $_casts
to reduce the likelihood of clashing with field names.