When I create new dish by clicking + button, a modal opens, all fields are saved in dishes table after submit, and this record is set to dish_id select of meal form but not my image in media table. Then when I try to edit this meal, back to create a new dish clicking + button, and after submit button modal, I get this error
Call to undefined method App\Models\MealItems::getMedia()
Call to undefined method App\Models\MealItems::getMedia()
.
In fact is normal since HasMedia is in Dish model and not MealItems
Forms\Components\Repeater::make('items')
Forms\Components\Repeater::make('items')
items is the name of my relationship
How do I say to spatie to get ID of Dish created to permit to save image in media table ?