I have the following Pivot table:
public function sheeps()
{
return $this->belongsToMany(Sheep::class, 'farm_sheep')->withTimestamps()->withPivot(['weight', 'foobar']);
}
Now I want a BelongsToMany
field that shows the values that are in the pivot Table, so: weight and foobar. But when I do that, it just shows the table with the data from the Sheep Nova resource. So not that pivot tables values. What am I doing wrong
BelongsToMany::make('Sheeps')
->fields(function () {
return [
Number::make('Weight'),
Textarea::make('Foobar'),
];
}),
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire