Samazer
SQL Error when saving, no such column
Here are the resources which are having issues
class FoodMenuSectionResource extends Resource
{
protected static ?string $model = FoodMenuSection::class;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('food_menu_id')
->relationship('menu', 'name')
->required(),
Forms\Components\TextInput::make('name')->required(),
Forms\Components\Textarea::make('description'),
]);
}
...
}
class FoodMenuSectionResource extends Resource
{
protected static ?string $model = FoodMenuSection::class;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('food_menu_id')
->relationship('menu', 'name')
->required(),
Forms\Components\TextInput::make('name')->required(),
Forms\Components\Textarea::make('description'),
]);
}
...
}
class FoodMenuItemResource extends Resource
{
protected static ?string $model = FoodMenuItem::class;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('food_menu_section_id')
->relationship('section', 'name')
->required(),
Forms\Components\TextInput::make('name')->required(),
Forms\Components\TextInput::make('price')->required()->numeric(),
Forms\Components\Textarea::make('description'),
Forms\Components\FileUpload::make('image')->image(),
Forms\Components\Select::make('suitable_for_diet')
->options([
'vegan' => 'Vegan',
'vegetarian' => 'Vegetarian',
'gluten_free' => 'Gluten Free',
])
->nullable(),
]);
}
...
}
class FoodMenuItemResource extends Resource
{
protected static ?string $model = FoodMenuItem::class;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('food_menu_section_id')
->relationship('section', 'name')
->required(),
Forms\Components\TextInput::make('name')->required(),
Forms\Components\TextInput::make('price')->required()->numeric(),
Forms\Components\Textarea::make('description'),
Forms\Components\FileUpload::make('image')->image(),
Forms\Components\Select::make('suitable_for_diet')
->options([
'vegan' => 'Vegan',
'vegetarian' => 'Vegetarian',
'gluten_free' => 'Gluten Free',
])
->nullable(),
]);
}
...
}
2 replies