I’m following the Surge tutorial, and have a page which lists all Cats in the database, with an Edit button which launches a modal with a form to edit that Cat's details. So far this is exactly the same as Caleb’s videos. The difference is that this Cat model has a relationship, it has many Fleas. So I have a dropdown in the modal form which lists all Fleas and allows you to select one.
The problem is, that following Caleb’s videos, the component’s save method looks like this:
public function save(): void
{
$this->validate();
$this->editing->save();
$this->showEditModal = false;
}
And when I click “save” in the modal I get this error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘flea’ in ‘field list’