ImportColumn::getRelationship()
I have a belongsToMany relationship between User and Hobbies and I am trying to implement the ImportAction. If I expect a string with the name of the hobby in the excel, how do I validate it in order to import it? The relationships are correctly defined in the models. #import
The error i got:
Filament\Actions\Imports\ImportColumn::getRelationship(): Return value must be of type ?Illuminate\Database\Eloquent\Relations\BelongsTo, Illuminate\Database\Eloquent\Relations\BelongsToMany returned
2 Replies
Do you have belongstomany instance ? Because from the error it expect belongsto but belongstomany is returned
ImportAction currently only support belongsTo relationship
For your use case, you can use the
beforeSave()
hook to accomplish your goal