mikebronner / nova-gutenberg

Implementation of the Gutenberg editor as a Laravel Nova Field based on Laraberg.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unknown column 'content' in 'field list'

ahinkle opened this issue · comments

Hi there! Thanks for putting together this great package. I'm using the latest version of Laravel Nova (3.x) and Laravel Framework (7.x).

I'm attempting to build content on my model. This model does not have a content database column. By reading the Laraberg documentation, I've attached use Gutenbergable to the model class.

I've added Gutenberg::make("Content") to the Model Resource. When I load the page, the Gutenberg editor appears. However, when I add content and save, I get the message Unknown column 'content' in 'field list' like it's looking for a column named content instead of saving to the morphed table.

What am I missing here?

Many thanks!

Hi @ahinkle, thanks for using the package. A few pointers:

  1. This is a package that wraps Laraberg. There is no need to follow Laraberg's installation instructions, it is not compatible. I recommend removing the trait from your model, and also remove any requirement for LaraBerg directly from composer.json.
  2. You will need to have a field on your model that you want to store the content in. Make sure to identify that field correctly in the Nova resource for that model. Something like Gutenberg::make("Content", "content_field") if the label is different from the field name.

Hope this helps! :) Good luck. Let me know how it works for you.