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
No description
2 Replies
einnlleinhatt_
einnlleinhatt_12mo ago
Do you have belongstomany instance ? Because from the error it expect belongsto but belongstomany is returned
Hussain4real
Hussain4real12mo ago
ImportAction currently only support belongsTo relationship For your use case, you can use the beforeSave() hook to accomplish your goal
Want results from more Discord servers?
Add your server