Import with relation.
Im doing something like this but is not working. how should I do this?
->relationship(
resolveUsing: function (string $category) {
$item = FoodItemCategory::firstOrCreate(
['name' => $category],
[
'description' => null,
'is_active' => true,
]
);
// $item->save();
return $item;
}
),
0 Replies