nova-flexible-content: Unable to parse incoming Flexible content, data should be an array.
I have this error when saving the resource:
exception: "Exception" file: "G:\laravel\headless\vendor\whitecube\nova-flexible-content\src\Flexible.php" line: 268 message: "Unable to parse incoming Flexible content, data should be an array."
my fields: `public function fields(Request $request) { return [ ID::make()->sortable(),
Flexible::make('Content')
->addLayout('Simple content section', 'wysiwyg', [
Text::make('Title'),
Markdown::make('Content')
])
->addLayout('Video section', 'video', [
Text::make('Title'),
Image::make('Video Thumbnail', 'thumbnail'),
Text::make('Video ID (YouTube)', 'video'),
Text::make('Video Caption', 'caption')
]),
];
}`
request payload:
model: `class Page extends Model { protected $fillable = [ ‘content’];
protected $casts = [
'content' => 'array'
];
}` nova version: 2.0.11 laravel version: 5.8.32
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (4 by maintainers)
@jackabox will release an update of flexible-content later today. It will contain a few fixes & new features along with a compatibility check for Nova 2.1.0.
Hi @jackabox & @yassir3wad,
We juste released v0.1.10, which is compatible with Nova 2.1.0. Could you check if this issue is still relevant?
Do not forget to
php artisan nova:publish
& hard-reload (cmd + shift + R
) Nova in your browser before submitting test data.@Nyratas No problem, that should inadvertently fix this issue as well. Hopefully, @yassir3wad can confirm when the new release is out! 😃
Your installed version of nova is
"laravel/nova": "*",
this will installdev-master
branch which isn’t 2.0.11 and will potentially have active changes on, this is probably what is causing a conflict.Change
"laravel/nova": "*",
to"laravel/nova": "^2.0.11",
in your composer.json and runcomposer install
and republish assets.Hope that helps.
I agree with @jackabox response. Solved the same issue by updating my nova
@yassir3wad had this issue recently, required updating to the latest version of nova, and republishing assets to ensure that it worked, as seen at https://nova.laravel.com/docs/2.0/installation.html#updating-nova