I’m following the Surge tutorial, and have a page which lists all Cat
s 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 Flea
s. So I have a dropdown in the modal form which lists all Flea
s 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’