SpatieMediaLibraryFileUpload inside createOptionForm()
Hello,
I have an exception when I save record with SpatieMediaLibraryFileUpload inside createOptionForm =>
Explanation :
I have a form to save a meal. Inside it, I have a repeater to insert many dishes.
To do that I use
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
In fact is normal since HasMedia is in Dish model and not MealItems
How do I say to spatie to get ID of Dish created to permit to save image in media table ?
Thank you
I have an exception when I save record with SpatieMediaLibraryFileUpload inside createOptionForm =>
Call to undefined method App\Models\MealItems::getMedia()Explanation :
I have a form to save a meal. Inside it, I have a repeater to insert many dishes.
To do that I use
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().In fact is normal since HasMedia is in Dish model and not MealItems
Forms\Components\Repeater::make('items') items is the name of my relationshipHow do I say to spatie to get ID of Dish created to permit to save image in media table ?
Thank you