relationship using Spatie Translatable

I'm using the Spatie Translatable package and have a relationship with categories
Forms\Components\Select::make('categories')
->relationship('categories', 'name')
->multiple()
Forms\Components\Select::make('categories')
->relationship('categories', 'name')
->multiple()
The problem is that the values retrieved from the relationship are being displayed in JSON format instead of the expected format. If you have any insights or suggestions on how to resolve this issue, I would greatly appreciate your help. Thank you!
3 Replies
omegar0643
omegar0643OP16mo ago
@saifallak i dont have category_id i have this relationship in my Model
public function categories(): MorphToMany
{
return $this->morphToMany(Category::class, 'categorizable');
}
public function categories(): MorphToMany
{
return $this->morphToMany(Category::class, 'categorizable');
}
Want results from more Discord servers?
Add your server