Feature(s) impacted
When creating a SmartCollection, how do we get the user to click through to a specific relation like the generated collections?
E.g. clicking on a record below, or even the artist ‘name’ I want to take the user to that artist record. The relations all exist but not sure that the smartcollection is aware of it - how do I declare the relationship?
The docs specify how to do this in SQL and MongoDB but not using Laravel implementation:
I’d assume I could use a similar decleration to the js approach, but this just causes the view to not render the ID column.
public function fields(): Collection
{
return collect(
[
new SmartField(
[
'field' => 'id',
'type' => 'Number',
'reference' => 'artists.id'
]
),
It does however seem to read this when editing the layout:
For reference the artists table referred to on the SmartField does exist here by that name, with an id field (also shown, id not rendering):
Also, I’ve tried ‘artist.id’ as the reference as this is what the underlying class is in the forest schema and at /data/artist/index, but then returns this console error
Observed behavior
Doesn’t render column if using a relationship on a smart field
Expected behavior
Renders the column with a click through to the related record
Failure Logs
Context
- Project name: …
- Team name: …
- Environment name: …
- Agent type & version: … Laravel 1.2.1
- Recent changes made on your end if any: …